@curviate/cli 0.21.1 → 0.23.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 +236 -116
- package/README.md +18 -18
- package/dist/{account-OIV73PXX.js → account-MIPWTAG5.js} +27 -27
- package/dist/chunk-3BO6GVS2.js +182 -0
- package/dist/{chunk-HZFK45IW.js → chunk-H6XD3F66.js} +1 -1
- package/dist/{chunk-VPKMJYIF.js → chunk-JA3NNST6.js} +9 -1
- package/dist/{chunk-OE7OMTCM.js → chunk-MBO4LBLY.js} +19 -23
- package/dist/{chunk-M6UDWFHX.js → chunk-PMRQXBCP.js} +1 -1
- package/dist/{chunk-WYRYCTUM.js → chunk-RFUO2G3M.js} +2 -2
- package/dist/{chunk-QJZ3LWOX.js → chunk-RJTG5YWE.js} +1 -1
- package/dist/{chunk-DMQZEPQE.js → chunk-UEAX6KUB.js} +10 -0
- package/dist/cli.js +58 -26
- package/dist/{comment-W4XTOTHN.js → comment-TUXC7K72.js} +19 -22
- package/dist/{company-NT4VO6JV.js → company-LHYDAO2C.js} +31 -34
- package/dist/{connect-VXWRLGQZ.js → connect-5S4TFQAF.js} +23 -26
- package/dist/{exit-codes-63JE5GM5.js → exit-codes-KAVZN5BQ.js} +1 -1
- package/dist/{feed-4Q3B56WI.js → feed-ISNH4NXB.js} +8 -11
- package/dist/{group-43PHTFP7.js → group-PHGUOOJE.js} +15 -15
- package/dist/{inbox-GZAOUWZP.js → inbox-3IQPPQMH.js} +14 -17
- package/dist/{inboxes-6AZOB43U.js → inboxes-JK36F6SK.js} +11 -14
- package/dist/{job-VOVQZGCK.js → job-JQG34ATV.js} +19 -22
- package/dist/{message-FIEWH2BU.js → message-2WIZESSM.js} +5 -3
- package/dist/{notification-65V67NWK.js → notification-ORSZY2IJ.js} +10 -13
- package/dist/{post-G4IMWUE2.js → post-JRJMGV2I.js} +22 -25
- package/dist/{profile-GADE33FY.js → profile-SUKHRWQP.js} +27 -30
- package/dist/{recruiter-LI2TMRHY.js → recruiter-NIKKDGMR.js} +38 -41
- package/dist/{sales-nav-OXLRN6YK.js → sales-nav-4MFL2JSE.js} +23 -26
- package/dist/{search-V35MFTXL.js → search-MZQJDJTX.js} +26 -29
- package/dist/{webhook-5HXMJQFO.js → webhook-7ESDSIRU.js} +9 -9
- package/package.json +4 -3
|
@@ -2,10 +2,13 @@
|
|
|
2
2
|
import {
|
|
3
3
|
pageDelayFromFlags,
|
|
4
4
|
streamAll
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-H6XD3F66.js";
|
|
6
6
|
import {
|
|
7
7
|
normalizeChatId
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-UEAX6KUB.js";
|
|
9
|
+
import {
|
|
10
|
+
requireAccount
|
|
11
|
+
} from "./chunk-3BO6GVS2.js";
|
|
9
12
|
import {
|
|
10
13
|
buildPreviewOutput
|
|
11
14
|
} from "./chunk-R3VLWLVV.js";
|
|
@@ -15,13 +18,14 @@ import {
|
|
|
15
18
|
renderSuccess,
|
|
16
19
|
renderUnexpectedError,
|
|
17
20
|
resolveEffectiveConfig
|
|
18
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-JA3NNST6.js";
|
|
19
22
|
import {
|
|
20
23
|
GLOBAL_FLAGS,
|
|
21
24
|
READ_SINGLE_FLAGS,
|
|
22
25
|
WRITE_SINGLE_FLAGS
|
|
23
26
|
} from "./chunk-CUTMZWL6.js";
|
|
24
27
|
import "./chunk-ZYURL5VK.js";
|
|
28
|
+
import "./chunk-PMRQXBCP.js";
|
|
25
29
|
|
|
26
30
|
// src/commands/inbox.ts
|
|
27
31
|
import { defineCommand } from "citty";
|
|
@@ -31,13 +35,6 @@ function buildOutputStreams() {
|
|
|
31
35
|
stderr: { write: (s) => process.stderr.write(s) }
|
|
32
36
|
};
|
|
33
37
|
}
|
|
34
|
-
function requireAccount(account, out) {
|
|
35
|
-
if (!account) {
|
|
36
|
-
out.stderr.write("error: --account is required for this command. Set it via --account, CURVIATE_ACCOUNT, or `curviate config set-account`.\n");
|
|
37
|
-
process.exit(2);
|
|
38
|
-
}
|
|
39
|
-
return account;
|
|
40
|
-
}
|
|
41
38
|
function rejectPreviewOnRead(preview, out) {
|
|
42
39
|
if (preview) {
|
|
43
40
|
out.stderr.write("error: --preview is only valid on write commands (mutations). Reads just run.\n");
|
|
@@ -85,7 +82,7 @@ function validateLimitRange(raw, out) {
|
|
|
85
82
|
async function handleSdkError(err, outOpts, out) {
|
|
86
83
|
const { CurviateError } = await import("@curviate/sdk");
|
|
87
84
|
if (err instanceof CurviateError) {
|
|
88
|
-
const { getExitCode } = await import("./exit-codes-
|
|
85
|
+
const { getExitCode } = await import("./exit-codes-KAVZN5BQ.js");
|
|
89
86
|
renderError(err, outOpts, out);
|
|
90
87
|
process.exit(getExitCode(err.code));
|
|
91
88
|
}
|
|
@@ -94,7 +91,7 @@ async function handleSdkError(err, outOpts, out) {
|
|
|
94
91
|
}
|
|
95
92
|
async function runInboxList(client, flags, out) {
|
|
96
93
|
rejectPreviewOnRead(flags.preview, out);
|
|
97
|
-
const accountId = requireAccount(flags
|
|
94
|
+
const accountId = await requireAccount(client, flags, out);
|
|
98
95
|
const ns = client.account(accountId);
|
|
99
96
|
const outOpts = resolveOutputOpts(flags);
|
|
100
97
|
const all = flags.all ?? false;
|
|
@@ -125,7 +122,7 @@ async function runInboxList(client, flags, out) {
|
|
|
125
122
|
async function runInboxGet(client, flags, out) {
|
|
126
123
|
rejectPreviewOnRead(flags.preview, out);
|
|
127
124
|
rejectAllOnNonPaginated(flags.all, out);
|
|
128
|
-
const accountId = requireAccount(flags
|
|
125
|
+
const accountId = await requireAccount(client, flags, out);
|
|
129
126
|
const chatId = normalizeChatId(flags.chatId ?? "");
|
|
130
127
|
const ns = client.account(accountId);
|
|
131
128
|
const outOpts = resolveOutputOpts(flags);
|
|
@@ -137,7 +134,7 @@ async function runInboxGet(client, flags, out) {
|
|
|
137
134
|
}
|
|
138
135
|
}
|
|
139
136
|
async function runInboxMarkRead(client, flags, out) {
|
|
140
|
-
const accountId = requireAccount(flags
|
|
137
|
+
const accountId = await requireAccount(client, flags, out);
|
|
141
138
|
const chatId = normalizeChatId(flags.chatId ?? "");
|
|
142
139
|
const body = { read: true };
|
|
143
140
|
if (flags.preview) {
|
|
@@ -156,7 +153,7 @@ async function runInboxMarkRead(client, flags, out) {
|
|
|
156
153
|
}
|
|
157
154
|
async function runInboxMessages(client, flags, out) {
|
|
158
155
|
rejectPreviewOnRead(flags.preview, out);
|
|
159
|
-
const accountId = requireAccount(flags
|
|
156
|
+
const accountId = await requireAccount(client, flags, out);
|
|
160
157
|
const chatId = normalizeChatId(flags.chatId ?? "");
|
|
161
158
|
const ns = client.account(accountId);
|
|
162
159
|
const outOpts = resolveOutputOpts(flags);
|
|
@@ -192,7 +189,7 @@ async function runInboxMessages(client, flags, out) {
|
|
|
192
189
|
}
|
|
193
190
|
async function runInboxSearch(client, flags, out) {
|
|
194
191
|
rejectPreviewOnRead(flags.preview, out);
|
|
195
|
-
const accountId = requireAccount(flags
|
|
192
|
+
const accountId = await requireAccount(client, flags, out);
|
|
196
193
|
const query = flags.query ?? "";
|
|
197
194
|
if (!query) {
|
|
198
195
|
out.stderr.write("error: <query> is required.\n");
|
|
@@ -229,7 +226,7 @@ var inboxListCommand = defineCommand({
|
|
|
229
226
|
unread: {
|
|
230
227
|
type: "boolean",
|
|
231
228
|
description: "Show unread chats only (--no-unread for read-only; omit for all)."
|
|
232
|
-
// No default
|
|
229
|
+
// No default -> three-way semantics: undefined when omitted, true for --unread, false for --no-unread
|
|
233
230
|
}
|
|
234
231
|
},
|
|
235
232
|
async run({ args }) {
|
|
@@ -2,19 +2,23 @@
|
|
|
2
2
|
import {
|
|
3
3
|
pageDelayFromFlags,
|
|
4
4
|
streamAll
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-H6XD3F66.js";
|
|
6
|
+
import {
|
|
7
|
+
requireAccount
|
|
8
|
+
} from "./chunk-3BO6GVS2.js";
|
|
6
9
|
import {
|
|
7
10
|
createClient,
|
|
8
11
|
renderError,
|
|
9
12
|
renderSuccess,
|
|
10
13
|
renderUnexpectedError,
|
|
11
14
|
resolveEffectiveConfig
|
|
12
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-JA3NNST6.js";
|
|
13
16
|
import {
|
|
14
17
|
GLOBAL_FLAGS,
|
|
15
18
|
READ_SINGLE_FLAGS
|
|
16
19
|
} from "./chunk-CUTMZWL6.js";
|
|
17
20
|
import "./chunk-ZYURL5VK.js";
|
|
21
|
+
import "./chunk-PMRQXBCP.js";
|
|
18
22
|
|
|
19
23
|
// src/commands/inboxes.ts
|
|
20
24
|
import { defineCommand } from "citty";
|
|
@@ -24,13 +28,6 @@ function buildOutputStreams() {
|
|
|
24
28
|
stderr: { write: (s) => process.stderr.write(s) }
|
|
25
29
|
};
|
|
26
30
|
}
|
|
27
|
-
function requireAccount(account, out) {
|
|
28
|
-
if (!account) {
|
|
29
|
-
out.stderr.write("error: --account is required for this command. Set it via --account, CURVIATE_ACCOUNT, or `curviate config set-account`.\n");
|
|
30
|
-
process.exit(2);
|
|
31
|
-
}
|
|
32
|
-
return account;
|
|
33
|
-
}
|
|
34
31
|
function rejectPreviewOnRead(preview, out) {
|
|
35
32
|
if (preview) {
|
|
36
33
|
out.stderr.write("error: --preview is only valid on write commands (mutations). Reads just run.\n");
|
|
@@ -54,7 +51,7 @@ function resolveOutputOpts(flags) {
|
|
|
54
51
|
async function handleSdkError(err, outOpts, out) {
|
|
55
52
|
const { CurviateError } = await import("@curviate/sdk");
|
|
56
53
|
if (err instanceof CurviateError) {
|
|
57
|
-
const { getExitCode } = await import("./exit-codes-
|
|
54
|
+
const { getExitCode } = await import("./exit-codes-KAVZN5BQ.js");
|
|
58
55
|
renderError(err, outOpts, out);
|
|
59
56
|
process.exit(getExitCode(err.code));
|
|
60
57
|
}
|
|
@@ -74,7 +71,7 @@ function validateLimitRange(raw, out) {
|
|
|
74
71
|
async function runInboxesList(client, flags, out) {
|
|
75
72
|
rejectPreviewOnRead(flags.preview, out);
|
|
76
73
|
rejectAllOnNonPaginated(flags.all, out);
|
|
77
|
-
const accountId = requireAccount(flags
|
|
74
|
+
const accountId = await requireAccount(client, flags, out);
|
|
78
75
|
const ns = client.account(accountId);
|
|
79
76
|
const outOpts = resolveOutputOpts(flags);
|
|
80
77
|
const params = {};
|
|
@@ -89,7 +86,7 @@ async function runInboxesList(client, flags, out) {
|
|
|
89
86
|
}
|
|
90
87
|
async function runInboxesChats(client, flags, out) {
|
|
91
88
|
rejectPreviewOnRead(flags.preview, out);
|
|
92
|
-
const accountId = requireAccount(flags
|
|
89
|
+
const accountId = await requireAccount(client, flags, out);
|
|
93
90
|
const inboxId = flags.inboxId ?? "";
|
|
94
91
|
const ns = client.account(accountId);
|
|
95
92
|
const outOpts = resolveOutputOpts(flags);
|
|
@@ -121,7 +118,7 @@ var inboxesListCommand = defineCommand({
|
|
|
121
118
|
meta: { name: "list", description: "Discover the account's inboxes (personal + company pages)." },
|
|
122
119
|
args: {
|
|
123
120
|
// Single-object-shaped read: READ_SINGLE_FLAGS omits pagination flags
|
|
124
|
-
// (this response carries no cursor
|
|
121
|
+
// (this response carries no cursor, every inbox comes back in one call).
|
|
125
122
|
...READ_SINGLE_FLAGS,
|
|
126
123
|
kind: {
|
|
127
124
|
type: "string",
|
|
@@ -153,7 +150,7 @@ var inboxesListCommand = defineCommand({
|
|
|
153
150
|
var inboxesChatsCommand = defineCommand({
|
|
154
151
|
meta: {
|
|
155
152
|
name: "chats",
|
|
156
|
-
description: "List an inbox's conversations. Each chat id is send-ready: reply with `message send <chat_id> \"<text>\"`. A company inbox's chat id (e.g. COMPANY_83734124_2
|
|
153
|
+
description: "List an inbox's conversations. Each chat id is send-ready: reply with `message send <chat_id> \"<text>\"`. A company inbox's chat id (e.g. COMPANY_83734124_2-...) sends AS THE PAGE, no separate flag needed. Company inboxes are reply-only and cannot start a new conversation."
|
|
157
154
|
},
|
|
158
155
|
args: {
|
|
159
156
|
...GLOBAL_FLAGS,
|
|
@@ -1,20 +1,23 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
slimJob
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-RFUO2G3M.js";
|
|
5
5
|
import {
|
|
6
6
|
DEFAULT_PAGE_DELAY_MS,
|
|
7
7
|
ndjsonModeNotice,
|
|
8
8
|
pageDelayFromFlags,
|
|
9
9
|
streamAll
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-H6XD3F66.js";
|
|
11
11
|
import {
|
|
12
12
|
BinaryOutputError,
|
|
13
13
|
writeBinaryOutput
|
|
14
14
|
} from "./chunk-UWO2D4HW.js";
|
|
15
15
|
import {
|
|
16
16
|
resolveJobIdentifier
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-UEAX6KUB.js";
|
|
18
|
+
import {
|
|
19
|
+
requireAccount
|
|
20
|
+
} from "./chunk-3BO6GVS2.js";
|
|
18
21
|
import {
|
|
19
22
|
buildPreviewOutput
|
|
20
23
|
} from "./chunk-R3VLWLVV.js";
|
|
@@ -24,13 +27,14 @@ import {
|
|
|
24
27
|
renderSuccess,
|
|
25
28
|
renderUnexpectedError,
|
|
26
29
|
resolveEffectiveConfig
|
|
27
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-JA3NNST6.js";
|
|
28
31
|
import {
|
|
29
32
|
GLOBAL_FLAGS,
|
|
30
33
|
READ_SINGLE_FLAGS,
|
|
31
34
|
WRITE_SINGLE_FLAGS
|
|
32
35
|
} from "./chunk-CUTMZWL6.js";
|
|
33
36
|
import "./chunk-ZYURL5VK.js";
|
|
37
|
+
import "./chunk-PMRQXBCP.js";
|
|
34
38
|
|
|
35
39
|
// src/commands/job.ts
|
|
36
40
|
import { defineCommand } from "citty";
|
|
@@ -60,13 +64,6 @@ function buildOutputStreams() {
|
|
|
60
64
|
stderr: { write: (s) => process.stderr.write(s) }
|
|
61
65
|
};
|
|
62
66
|
}
|
|
63
|
-
function requireAccount(account, out) {
|
|
64
|
-
if (!account) {
|
|
65
|
-
out.stderr.write("error: --account is required for this command. Set it via --account, CURVIATE_ACCOUNT, or `curviate config set-account`.\n");
|
|
66
|
-
process.exit(2);
|
|
67
|
-
}
|
|
68
|
-
return account;
|
|
69
|
-
}
|
|
70
67
|
function rejectPreviewOnRead(preview, out) {
|
|
71
68
|
if (preview) {
|
|
72
69
|
out.stderr.write("error: --preview is only valid on write commands (mutations). Reads just run.\n");
|
|
@@ -99,7 +96,7 @@ function requireEnum(value, allowed, flag, out) {
|
|
|
99
96
|
async function handleSdkError(err, outOpts, out) {
|
|
100
97
|
const { CurviateError } = await import("@curviate/sdk");
|
|
101
98
|
if (err instanceof CurviateError) {
|
|
102
|
-
const { getExitCode } = await import("./exit-codes-
|
|
99
|
+
const { getExitCode } = await import("./exit-codes-KAVZN5BQ.js");
|
|
103
100
|
renderError(err, outOpts, out);
|
|
104
101
|
process.exit(getExitCode(err.code));
|
|
105
102
|
}
|
|
@@ -123,7 +120,7 @@ function buildApplyMethod(flags, out) {
|
|
|
123
120
|
}
|
|
124
121
|
async function runJobGet(client, flags, out) {
|
|
125
122
|
rejectPreviewOnRead(flags.preview, out);
|
|
126
|
-
const accountId = requireAccount(flags
|
|
123
|
+
const accountId = await requireAccount(client, flags, out);
|
|
127
124
|
const resolvedId = resolveJobIdentifier(flags.id ?? "");
|
|
128
125
|
const ns = client.account(accountId);
|
|
129
126
|
const outOpts = resolveOutputOpts(flags);
|
|
@@ -136,7 +133,7 @@ async function runJobGet(client, flags, out) {
|
|
|
136
133
|
}
|
|
137
134
|
async function runJobList(client, flags, out) {
|
|
138
135
|
rejectPreviewOnRead(flags.preview, out);
|
|
139
|
-
const accountId = requireAccount(flags
|
|
136
|
+
const accountId = await requireAccount(client, flags, out);
|
|
140
137
|
const state = requireFlag(flags.state, "--state", out);
|
|
141
138
|
const ns = client.account(accountId);
|
|
142
139
|
const outOpts = resolveOutputOpts(flags);
|
|
@@ -241,7 +238,7 @@ async function runJobListAllStates(ns, flags, out, outOpts, opts) {
|
|
|
241
238
|
}
|
|
242
239
|
async function runJobBudget(client, flags, out) {
|
|
243
240
|
rejectPreviewOnRead(flags.preview, out);
|
|
244
|
-
const accountId = requireAccount(flags
|
|
241
|
+
const accountId = await requireAccount(client, flags, out);
|
|
245
242
|
const jobId = resolveJobIdentifier(flags.id ?? "");
|
|
246
243
|
const ns = client.account(accountId);
|
|
247
244
|
const outOpts = resolveOutputOpts(flags);
|
|
@@ -254,7 +251,7 @@ async function runJobBudget(client, flags, out) {
|
|
|
254
251
|
}
|
|
255
252
|
async function runJobApplicants(client, flags, out) {
|
|
256
253
|
rejectPreviewOnRead(flags.preview, out);
|
|
257
|
-
const accountId = requireAccount(flags
|
|
254
|
+
const accountId = await requireAccount(client, flags, out);
|
|
258
255
|
const jobId = resolveJobIdentifier(flags.id ?? "");
|
|
259
256
|
const ns = client.account(accountId);
|
|
260
257
|
const outOpts = resolveOutputOpts(flags);
|
|
@@ -288,7 +285,7 @@ async function runJobApplicants(client, flags, out) {
|
|
|
288
285
|
}
|
|
289
286
|
async function runJobApplicantGet(client, flags, out) {
|
|
290
287
|
rejectPreviewOnRead(flags.preview, out);
|
|
291
|
-
const accountId = requireAccount(flags
|
|
288
|
+
const accountId = await requireAccount(client, flags, out);
|
|
292
289
|
const jobId = resolveJobIdentifier(flags.id ?? "");
|
|
293
290
|
const applicantId = flags.applicantId ?? "";
|
|
294
291
|
const ns = client.account(accountId);
|
|
@@ -302,7 +299,7 @@ async function runJobApplicantGet(client, flags, out) {
|
|
|
302
299
|
}
|
|
303
300
|
async function runJobApplicantResume(client, flags, out, isTTY) {
|
|
304
301
|
rejectPreviewOnRead(flags.preview, out);
|
|
305
|
-
const accountId = requireAccount(flags
|
|
302
|
+
const accountId = await requireAccount(client, flags, out);
|
|
306
303
|
const jobId = resolveJobIdentifier(flags.id ?? "");
|
|
307
304
|
const applicantId = flags.applicantId ?? "";
|
|
308
305
|
const ns = client.account(accountId);
|
|
@@ -319,7 +316,7 @@ async function runJobApplicantResume(client, flags, out, isTTY) {
|
|
|
319
316
|
}
|
|
320
317
|
}
|
|
321
318
|
async function runJobCreate(client, flags, out) {
|
|
322
|
-
const accountId = requireAccount(flags
|
|
319
|
+
const accountId = await requireAccount(client, flags, out);
|
|
323
320
|
if (!flags["job-title"] && !flags["job-title-id"]) {
|
|
324
321
|
out.stderr.write("error: --job-title (a free-text name) or --job-title-id is required.\n");
|
|
325
322
|
process.exit(2);
|
|
@@ -363,7 +360,7 @@ async function runJobCreate(client, flags, out) {
|
|
|
363
360
|
}
|
|
364
361
|
}
|
|
365
362
|
async function runJobUpdate(client, flags, out) {
|
|
366
|
-
const accountId = requireAccount(flags
|
|
363
|
+
const accountId = await requireAccount(client, flags, out);
|
|
367
364
|
const jobId = resolveJobIdentifier(flags.id ?? "");
|
|
368
365
|
const body = {};
|
|
369
366
|
const jobTitle = buildRef(flags["job-title-id"], flags["job-title"]);
|
|
@@ -397,7 +394,7 @@ async function runJobUpdate(client, flags, out) {
|
|
|
397
394
|
}
|
|
398
395
|
}
|
|
399
396
|
async function runJobPublish(client, flags, out) {
|
|
400
|
-
const accountId = requireAccount(flags
|
|
397
|
+
const accountId = await requireAccount(client, flags, out);
|
|
401
398
|
const jobId = resolveJobIdentifier(flags.id ?? "");
|
|
402
399
|
const mode = requireFlag(flags.mode, "--mode", out);
|
|
403
400
|
requireEnum(mode, PUBLISH_MODES, "--mode", out);
|
|
@@ -429,7 +426,7 @@ async function runJobPublish(client, flags, out) {
|
|
|
429
426
|
}
|
|
430
427
|
}
|
|
431
428
|
async function runJobClose(client, flags, out) {
|
|
432
|
-
const accountId = requireAccount(flags
|
|
429
|
+
const accountId = await requireAccount(client, flags, out);
|
|
433
430
|
const jobId = resolveJobIdentifier(flags.id ?? "");
|
|
434
431
|
if (flags.preview) {
|
|
435
432
|
const preview = buildPreviewOutput({ method: "jobs.close", args: { job_id: jobId }, body: {}, account: accountId });
|
|
@@ -13,15 +13,17 @@ import {
|
|
|
13
13
|
runMessageSend,
|
|
14
14
|
sentAsNotice,
|
|
15
15
|
willSendAsNotice
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-MBO4LBLY.js";
|
|
17
17
|
import "./chunk-HOQ7EUHJ.js";
|
|
18
18
|
import "./chunk-BGZW6B7G.js";
|
|
19
19
|
import "./chunk-UWO2D4HW.js";
|
|
20
|
-
import "./chunk-
|
|
20
|
+
import "./chunk-UEAX6KUB.js";
|
|
21
|
+
import "./chunk-3BO6GVS2.js";
|
|
21
22
|
import "./chunk-R3VLWLVV.js";
|
|
22
|
-
import "./chunk-
|
|
23
|
+
import "./chunk-JA3NNST6.js";
|
|
23
24
|
import "./chunk-CUTMZWL6.js";
|
|
24
25
|
import "./chunk-ZYURL5VK.js";
|
|
26
|
+
import "./chunk-PMRQXBCP.js";
|
|
25
27
|
export {
|
|
26
28
|
guardBareMessageForm,
|
|
27
29
|
messageCommand,
|
|
@@ -2,7 +2,10 @@
|
|
|
2
2
|
import {
|
|
3
3
|
pageDelayFromFlags,
|
|
4
4
|
streamAll
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-H6XD3F66.js";
|
|
6
|
+
import {
|
|
7
|
+
requireAccount
|
|
8
|
+
} from "./chunk-3BO6GVS2.js";
|
|
6
9
|
import {
|
|
7
10
|
buildPreviewOutput
|
|
8
11
|
} from "./chunk-R3VLWLVV.js";
|
|
@@ -12,12 +15,13 @@ import {
|
|
|
12
15
|
renderSuccess,
|
|
13
16
|
renderUnexpectedError,
|
|
14
17
|
resolveEffectiveConfig
|
|
15
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-JA3NNST6.js";
|
|
16
19
|
import {
|
|
17
20
|
GLOBAL_FLAGS,
|
|
18
21
|
WRITE_SINGLE_FLAGS
|
|
19
22
|
} from "./chunk-CUTMZWL6.js";
|
|
20
23
|
import "./chunk-ZYURL5VK.js";
|
|
24
|
+
import "./chunk-PMRQXBCP.js";
|
|
21
25
|
|
|
22
26
|
// src/commands/notification.ts
|
|
23
27
|
import { defineCommand } from "citty";
|
|
@@ -27,13 +31,6 @@ function buildOutputStreams() {
|
|
|
27
31
|
stderr: { write: (s) => process.stderr.write(s) }
|
|
28
32
|
};
|
|
29
33
|
}
|
|
30
|
-
function requireAccount(account, out) {
|
|
31
|
-
if (!account) {
|
|
32
|
-
out.stderr.write("error: --account is required for this command. Set it via --account, CURVIATE_ACCOUNT, or `curviate config set-account`.\n");
|
|
33
|
-
process.exit(2);
|
|
34
|
-
}
|
|
35
|
-
return account;
|
|
36
|
-
}
|
|
37
34
|
function rejectPreviewOnRead(preview, out) {
|
|
38
35
|
if (preview) {
|
|
39
36
|
out.stderr.write("error: --preview is only valid on write commands (mutations). Reads just run.\n");
|
|
@@ -51,7 +48,7 @@ function resolveOutputOpts(flags) {
|
|
|
51
48
|
async function handleSdkError(err, outOpts, out) {
|
|
52
49
|
const { CurviateError } = await import("@curviate/sdk");
|
|
53
50
|
if (err instanceof CurviateError) {
|
|
54
|
-
const { getExitCode } = await import("./exit-codes-
|
|
51
|
+
const { getExitCode } = await import("./exit-codes-KAVZN5BQ.js");
|
|
55
52
|
renderError(err, outOpts, out);
|
|
56
53
|
process.exit(getExitCode(err.code));
|
|
57
54
|
}
|
|
@@ -60,7 +57,7 @@ async function handleSdkError(err, outOpts, out) {
|
|
|
60
57
|
}
|
|
61
58
|
async function runNotificationList(client, flags, out) {
|
|
62
59
|
rejectPreviewOnRead(flags.preview, out);
|
|
63
|
-
const accountId = requireAccount(flags
|
|
60
|
+
const accountId = await requireAccount(client, flags, out);
|
|
64
61
|
const ns = client.account(accountId);
|
|
65
62
|
const outOpts = resolveOutputOpts(flags);
|
|
66
63
|
const all = flags.all ?? false;
|
|
@@ -88,7 +85,7 @@ async function runNotificationList(client, flags, out) {
|
|
|
88
85
|
}
|
|
89
86
|
}
|
|
90
87
|
async function runNotificationDelete(client, flags, out) {
|
|
91
|
-
const accountId = requireAccount(flags
|
|
88
|
+
const accountId = await requireAccount(client, flags, out);
|
|
92
89
|
const cardUrn = flags.cardUrn ?? "";
|
|
93
90
|
if (flags.preview) {
|
|
94
91
|
const preview = buildPreviewOutput({ method: "notifications.delete", args: { card_urn: cardUrn }, body: {}, account: accountId });
|
|
@@ -105,7 +102,7 @@ async function runNotificationDelete(client, flags, out) {
|
|
|
105
102
|
}
|
|
106
103
|
}
|
|
107
104
|
async function runNotificationShowLess(client, flags, out) {
|
|
108
|
-
const accountId = requireAccount(flags
|
|
105
|
+
const accountId = await requireAccount(client, flags, out);
|
|
109
106
|
const cardUrn = flags.cardUrn ?? "";
|
|
110
107
|
if (flags.preview) {
|
|
111
108
|
const preview = buildPreviewOutput({ method: "notifications.showLess", args: { card_urn: cardUrn }, body: {}, account: accountId });
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
resolveMemberOrMeProviderId
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-RJTG5YWE.js";
|
|
5
5
|
import {
|
|
6
6
|
AttachError,
|
|
7
7
|
readAttachment,
|
|
@@ -10,8 +10,11 @@ import {
|
|
|
10
10
|
import {
|
|
11
11
|
pageDelayFromFlags,
|
|
12
12
|
streamAll
|
|
13
|
-
} from "./chunk-
|
|
14
|
-
import "./chunk-
|
|
13
|
+
} from "./chunk-H6XD3F66.js";
|
|
14
|
+
import "./chunk-UEAX6KUB.js";
|
|
15
|
+
import {
|
|
16
|
+
requireAccount
|
|
17
|
+
} from "./chunk-3BO6GVS2.js";
|
|
15
18
|
import {
|
|
16
19
|
buildPreviewOutput
|
|
17
20
|
} from "./chunk-R3VLWLVV.js";
|
|
@@ -21,7 +24,7 @@ import {
|
|
|
21
24
|
renderSuccess,
|
|
22
25
|
renderUnexpectedError,
|
|
23
26
|
resolveEffectiveConfig
|
|
24
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-JA3NNST6.js";
|
|
25
28
|
import {
|
|
26
29
|
GLOBAL_FLAGS,
|
|
27
30
|
WRITE_FLAGS,
|
|
@@ -30,6 +33,7 @@ import {
|
|
|
30
33
|
import {
|
|
31
34
|
resolveTextOrStdin
|
|
32
35
|
} from "./chunk-ZYURL5VK.js";
|
|
36
|
+
import "./chunk-PMRQXBCP.js";
|
|
33
37
|
|
|
34
38
|
// src/commands/post.ts
|
|
35
39
|
import { defineCommand } from "citty";
|
|
@@ -40,13 +44,6 @@ function buildOutputStreams() {
|
|
|
40
44
|
stderr: { write: (s) => process.stderr.write(s) }
|
|
41
45
|
};
|
|
42
46
|
}
|
|
43
|
-
function requireAccount(account, out) {
|
|
44
|
-
if (!account) {
|
|
45
|
-
out.stderr.write("error: --account is required for this command. Set it via --account, CURVIATE_ACCOUNT, or `curviate config set-account`.\n");
|
|
46
|
-
process.exit(2);
|
|
47
|
-
}
|
|
48
|
-
return account;
|
|
49
|
-
}
|
|
50
47
|
function rejectPreviewOnRead(preview, out) {
|
|
51
48
|
if (preview) {
|
|
52
49
|
out.stderr.write("error: --preview is only valid on write commands (mutations). Reads just run.\n");
|
|
@@ -79,7 +76,7 @@ function normalizeAttachPaths(attach) {
|
|
|
79
76
|
async function handleSdkError(err, outOpts, out) {
|
|
80
77
|
const { CurviateError } = await import("@curviate/sdk");
|
|
81
78
|
if (err instanceof CurviateError) {
|
|
82
|
-
const { getExitCode } = await import("./exit-codes-
|
|
79
|
+
const { getExitCode } = await import("./exit-codes-KAVZN5BQ.js");
|
|
83
80
|
renderError(err, outOpts, out);
|
|
84
81
|
process.exit(getExitCode(err.code));
|
|
85
82
|
}
|
|
@@ -89,7 +86,7 @@ async function handleSdkError(err, outOpts, out) {
|
|
|
89
86
|
async function runPostGet(client, flags, out) {
|
|
90
87
|
rejectPreviewOnRead(flags.preview, out);
|
|
91
88
|
rejectAllOnNonPaginated(flags.all, out);
|
|
92
|
-
const accountId = requireAccount(flags
|
|
89
|
+
const accountId = await requireAccount(client, flags, out);
|
|
93
90
|
const postId = flags.postId ?? "";
|
|
94
91
|
const ns = client.account(accountId);
|
|
95
92
|
const outOpts = resolveOutputOpts(flags);
|
|
@@ -101,7 +98,7 @@ async function runPostGet(client, flags, out) {
|
|
|
101
98
|
}
|
|
102
99
|
}
|
|
103
100
|
async function runPostCreate(client, flags, out, _readStdin) {
|
|
104
|
-
const accountId = requireAccount(flags
|
|
101
|
+
const accountId = await requireAccount(client, flags, out);
|
|
105
102
|
const rawText = flags.text ?? "";
|
|
106
103
|
const attachPaths = normalizeAttachPaths(flags.attach);
|
|
107
104
|
const text = await resolveTextOrStdin(rawText, out, _readStdin);
|
|
@@ -146,7 +143,7 @@ async function runPostCreate(client, flags, out, _readStdin) {
|
|
|
146
143
|
}
|
|
147
144
|
}
|
|
148
145
|
async function runPostReact(client, flags, out) {
|
|
149
|
-
const accountId = requireAccount(flags
|
|
146
|
+
const accountId = await requireAccount(client, flags, out);
|
|
150
147
|
const postId = flags.postId ?? "";
|
|
151
148
|
const reaction = flags.reaction ?? flags.reactionAlias ?? "";
|
|
152
149
|
if (!VALID_REACTIONS.has(reaction)) {
|
|
@@ -183,7 +180,7 @@ async function runPostReact(client, flags, out) {
|
|
|
183
180
|
}
|
|
184
181
|
async function runPostReactions(client, flags, out) {
|
|
185
182
|
rejectPreviewOnRead(flags.preview, out);
|
|
186
|
-
const accountId = requireAccount(flags
|
|
183
|
+
const accountId = await requireAccount(client, flags, out);
|
|
187
184
|
const postId = flags.postId ?? "";
|
|
188
185
|
const ns = client.account(accountId);
|
|
189
186
|
const outOpts = resolveOutputOpts(flags);
|
|
@@ -210,7 +207,7 @@ async function runPostReactions(client, flags, out) {
|
|
|
210
207
|
}
|
|
211
208
|
async function runPostSaved(client, flags, out) {
|
|
212
209
|
rejectPreviewOnRead(flags.preview, out);
|
|
213
|
-
const accountId = requireAccount(flags
|
|
210
|
+
const accountId = await requireAccount(client, flags, out);
|
|
214
211
|
const ns = client.account(accountId);
|
|
215
212
|
const outOpts = resolveOutputOpts(flags);
|
|
216
213
|
const all = flags.all ?? false;
|
|
@@ -235,7 +232,7 @@ async function runPostSaved(client, flags, out) {
|
|
|
235
232
|
}
|
|
236
233
|
}
|
|
237
234
|
async function runPostSave(client, flags, out) {
|
|
238
|
-
const accountId = requireAccount(flags
|
|
235
|
+
const accountId = await requireAccount(client, flags, out);
|
|
239
236
|
const postId = flags.postId ?? "";
|
|
240
237
|
if (flags.preview) {
|
|
241
238
|
const preview = buildPreviewOutput({ method: "posts.save", args: { post_id: postId }, body: {}, account: accountId });
|
|
@@ -252,7 +249,7 @@ async function runPostSave(client, flags, out) {
|
|
|
252
249
|
}
|
|
253
250
|
}
|
|
254
251
|
async function runPostUnsave(client, flags, out) {
|
|
255
|
-
const accountId = requireAccount(flags
|
|
252
|
+
const accountId = await requireAccount(client, flags, out);
|
|
256
253
|
const postId = flags.postId ?? "";
|
|
257
254
|
if (flags.preview) {
|
|
258
255
|
const preview = buildPreviewOutput({ method: "posts.unsave", args: { post_id: postId }, body: {}, account: accountId });
|
|
@@ -269,7 +266,7 @@ async function runPostUnsave(client, flags, out) {
|
|
|
269
266
|
}
|
|
270
267
|
}
|
|
271
268
|
async function runPostDelete(client, flags, out) {
|
|
272
|
-
const accountId = requireAccount(flags
|
|
269
|
+
const accountId = await requireAccount(client, flags, out);
|
|
273
270
|
const postId = flags.postId ?? "";
|
|
274
271
|
if (flags.preview) {
|
|
275
272
|
const preview = buildPreviewOutput({ method: "posts.delete", args: { post_id: postId }, body: {}, account: accountId });
|
|
@@ -286,7 +283,7 @@ async function runPostDelete(client, flags, out) {
|
|
|
286
283
|
}
|
|
287
284
|
}
|
|
288
285
|
async function runPostUnreact(client, flags, out) {
|
|
289
|
-
const accountId = requireAccount(flags
|
|
286
|
+
const accountId = await requireAccount(client, flags, out);
|
|
290
287
|
const postId = flags.postId ?? "";
|
|
291
288
|
const reaction = flags.reaction ?? "";
|
|
292
289
|
if (!VALID_REACTIONS.has(reaction)) {
|
|
@@ -316,7 +313,7 @@ async function runPostUnreact(client, flags, out) {
|
|
|
316
313
|
}
|
|
317
314
|
async function runPostUserPosts(client, flags, out) {
|
|
318
315
|
rejectPreviewOnRead(flags.preview, out);
|
|
319
|
-
const accountId = requireAccount(flags
|
|
316
|
+
const accountId = await requireAccount(client, flags, out);
|
|
320
317
|
const ns = client.account(accountId);
|
|
321
318
|
const outOpts = resolveOutputOpts(flags);
|
|
322
319
|
let userId;
|
|
@@ -349,7 +346,7 @@ async function runPostUserPosts(client, flags, out) {
|
|
|
349
346
|
}
|
|
350
347
|
async function runPostUserReactions(client, flags, out) {
|
|
351
348
|
rejectPreviewOnRead(flags.preview, out);
|
|
352
|
-
const accountId = requireAccount(flags
|
|
349
|
+
const accountId = await requireAccount(client, flags, out);
|
|
353
350
|
const ns = client.account(accountId);
|
|
354
351
|
const outOpts = resolveOutputOpts(flags);
|
|
355
352
|
let userId;
|
|
@@ -448,7 +445,7 @@ var postReactCommand = defineCommand({
|
|
|
448
445
|
reaction: {
|
|
449
446
|
type: "positional",
|
|
450
447
|
required: false,
|
|
451
|
-
description: "Write-side reaction (lowercase). Write values: like, celebrate, support, love, insightful, funny. Read-side vocabulary (in the value and user_reacted response fields): LIKE, PRAISE, APPRECIATION, EMPATHY, INTEREST, ENTERTAINMENT. Confirmed write
|
|
448
|
+
description: "Write-side reaction (lowercase). Write values: like, celebrate, support, love, insightful, funny. Read-side vocabulary (in the value and user_reacted response fields): LIKE, PRAISE, APPRECIATION, EMPATHY, INTEREST, ENTERTAINMENT. Confirmed write->read mappings: like=LIKE, celebrate=PRAISE, insightful=INTEREST. (support, love, and funny are valid write values; their read-side pairings are unconfirmed.)"
|
|
452
449
|
},
|
|
453
450
|
reactionAlias: {
|
|
454
451
|
type: "string",
|
|
@@ -606,7 +603,7 @@ var postCommand = defineCommand({
|
|
|
606
603
|
},
|
|
607
604
|
async run() {
|
|
608
605
|
process.stderr.write(
|
|
609
|
-
'Usage: curviate post <subcommand>\n get <post_id>\n create "<text>" [--attach <file
|
|
606
|
+
'Usage: curviate post <subcommand>\n get <post_id>\n create "<text>" [--attach <file>...]\n react <post_id> <reaction> [--as-organization <org_id>]\n reactions <post_id>\n delete <post_id>\n unreact <post_id> <reaction>\n saved\n save <post_id>\n unsave <post_id>\n user-posts <user_id>\n user-reactions <user_id>\n\nComment operations moved to the `comment` command group.\n'
|
|
610
607
|
);
|
|
611
608
|
}
|
|
612
609
|
});
|