@curviate/cli 0.20.0 → 0.21.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 +38 -0
- package/dist/{account-2SOSCEB6.js → account-A3FOYUKC.js} +5 -5
- package/dist/{chunk-42VUUKQ3.js → chunk-56ORAZJO.js} +4 -1
- package/dist/{chunk-DW2HCRXJ.js → chunk-CUTMZWL6.js} +4 -0
- package/dist/{chunk-HDQUEFD2.js → chunk-LMVDURUZ.js} +23 -1
- package/dist/{chunk-IGCQNDIG.js → chunk-Q7XG2VIF.js} +10 -10
- package/dist/chunk-ZYURL5VK.js +83 -0
- package/dist/cli.js +37 -22
- package/dist/{comment-AXDINBPS.js → comment-RPLZHFJQ.js} +8 -8
- package/dist/{company-BX4VDXZX.js → company-DFJK2RHM.js} +7 -7
- package/dist/{config-3O4N2XSH.js → config-FPWWYG7G.js} +2 -1
- package/dist/{connect-KWOJKCIB.js → connect-ELSSMOIC.js} +3 -2
- package/dist/{feed-4ROKUBG5.js → feed-23Z7OQNL.js} +3 -2
- package/dist/{group-L7TQEEFN.js → group-52MP24W3.js} +3 -2
- package/dist/{inbox-GMGZVDTQ.js → inbox-G6KNWWLI.js} +3 -2
- package/dist/{inboxes-YVYLSM5W.js → inboxes-NTTYCQPM.js} +3 -2
- package/dist/{job-TYBA2DUQ.js → job-WOPIAHOR.js} +3 -2
- package/dist/{login-W7NCDZOQ.js → login-ZLDDIAFW.js} +13 -14
- package/dist/{message-C6FV6JH6.js → message-KJXY5RCD.js} +4 -4
- package/dist/{notification-45XFT3S4.js → notification-MNEABNVW.js} +3 -2
- package/dist/{post-RETV3WUG.js → post-A7YZWBFG.js} +6 -6
- package/dist/{profile-A2TWF4HB.js → profile-XOMDIYSY.js} +3 -2
- package/dist/{recruiter-FQAKY6Z2.js → recruiter-CCLG4PM4.js} +10 -7
- package/dist/{sales-nav-SSJIZUNB.js → sales-nav-5ZRE2UAQ.js} +6 -5
- package/dist/{search-DH6BJFQC.js → search-NDESJC3Y.js} +5 -3
- package/dist/{webhook-LED6AKF3.js → webhook-TNZF3FMN.js} +8 -7
- package/package.json +1 -1
- package/dist/chunk-U7Y4EXHT.js +0 -33
package/CHANGELOG.md
CHANGED
|
@@ -8,6 +8,44 @@ 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.21.0] - 2026-08-04
|
|
12
|
+
|
|
13
|
+
A correctness release for every argument that reads from stdin. Upgrade
|
|
14
|
+
immediately if you are on 0.20.0: on that version the documented quick-start
|
|
15
|
+
login silently stored a placeholder instead of your API key, so the very first
|
|
16
|
+
command after it failed and blamed your key.
|
|
17
|
+
|
|
18
|
+
### Fixed
|
|
19
|
+
|
|
20
|
+
- **`curviate login --api-key -` now stores the piped key.** It previously
|
|
21
|
+
reported success and exited 0 while writing the literal string
|
|
22
|
+
`__curviate_stdin__` into your config, so every later command answered 401 and
|
|
23
|
+
attributed the failure to your API key. That is the first command in the
|
|
24
|
+
quick-start, so a new install failed on first contact with a misleading cause.
|
|
25
|
+
|
|
26
|
+
- **Eleven further arguments documented as accepting `-` now read stdin.** Each
|
|
27
|
+
compared its raw value against `-`, but the dispatcher had already substituted
|
|
28
|
+
an internal placeholder by that point, so the branch was unreachable and the
|
|
29
|
+
placeholder was consumed as your data. Affected: `--filters` on the eight
|
|
30
|
+
search and list commands, and `--body` on the three recruiter and webhook
|
|
31
|
+
commands, which answered `--filters is not valid JSON` or
|
|
32
|
+
`--body only accepts '-'` to a caller who had passed exactly that.
|
|
33
|
+
|
|
34
|
+
### Changed
|
|
35
|
+
|
|
36
|
+
- **A bare `-` is only special on an argument that declares a stdin contract.**
|
|
37
|
+
Every other argument now receives a literal `-`, restored between the parser
|
|
38
|
+
and the handler. Previously the substitution was indiscriminate, so a bare `-`
|
|
39
|
+
became the internal placeholder at any argument, including places where it
|
|
40
|
+
then travelled to the wire as a value. If you were relying on `-` being read
|
|
41
|
+
from stdin on an argument whose help text does not describe that behaviour, it
|
|
42
|
+
no longer is; the arguments that document the contract are unchanged.
|
|
43
|
+
|
|
44
|
+
- **The internal placeholder can no longer leave the process.** The request
|
|
45
|
+
transport and the config writer both refuse it as a defence in depth backstop,
|
|
46
|
+
and report what to do instead, so no future argument can leak it into a
|
|
47
|
+
request or a config file.
|
|
48
|
+
|
|
11
49
|
## [0.20.0] - 2026-08-03
|
|
12
50
|
|
|
13
51
|
A safety and correctness release. Upgrade promptly: it closes a path by which a
|
|
@@ -5,9 +5,6 @@ import {
|
|
|
5
5
|
import {
|
|
6
6
|
AUTH_NEEDED
|
|
7
7
|
} from "./chunk-M6UDWFHX.js";
|
|
8
|
-
import {
|
|
9
|
-
defaultReadStdin
|
|
10
|
-
} from "./chunk-U7Y4EXHT.js";
|
|
11
8
|
import {
|
|
12
9
|
slimAccountGet,
|
|
13
10
|
slimAccountList,
|
|
@@ -26,12 +23,15 @@ import {
|
|
|
26
23
|
renderSuccess,
|
|
27
24
|
renderUnexpectedError,
|
|
28
25
|
resolveEffectiveConfig
|
|
29
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-LMVDURUZ.js";
|
|
30
27
|
import {
|
|
31
28
|
GLOBAL_FLAGS,
|
|
32
29
|
READ_SINGLE_FLAGS,
|
|
33
30
|
WRITE_SINGLE_FLAGS
|
|
34
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-CUTMZWL6.js";
|
|
32
|
+
import {
|
|
33
|
+
defaultReadStdin
|
|
34
|
+
} from "./chunk-ZYURL5VK.js";
|
|
35
35
|
|
|
36
36
|
// src/commands/account.ts
|
|
37
37
|
import { defineCommand } from "citty";
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
isStdinToken
|
|
4
|
+
} from "./chunk-ZYURL5VK.js";
|
|
2
5
|
|
|
3
6
|
// src/lib/search-filters.ts
|
|
4
7
|
import { readFile } from "fs/promises";
|
|
@@ -23,7 +26,7 @@ async function assembleFilters(flags, readers = DEFAULT_FILTER_READERS) {
|
|
|
23
26
|
} catch {
|
|
24
27
|
return { error: `cannot read ${source}` };
|
|
25
28
|
}
|
|
26
|
-
} else if (flags.filters
|
|
29
|
+
} else if (isStdinToken(flags.filters)) {
|
|
27
30
|
source = "--filters - (stdin)";
|
|
28
31
|
raw = await readers.readStdin();
|
|
29
32
|
} else if (flags.filters !== void 0) {
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
assertNoStdinPlaceholder
|
|
4
|
+
} from "./chunk-ZYURL5VK.js";
|
|
2
5
|
|
|
3
6
|
// src/lib/config.ts
|
|
4
7
|
import {
|
|
@@ -37,6 +40,7 @@ async function writeConfig(cfg) {
|
|
|
37
40
|
} catch {
|
|
38
41
|
}
|
|
39
42
|
const content = JSON.stringify(cfg, null, 2) + "\n";
|
|
43
|
+
assertNoStdinPlaceholder("the configuration about to be written", [content]);
|
|
40
44
|
const tmpPath = join(
|
|
41
45
|
tmpdir(),
|
|
42
46
|
`curviate-cfg-${randomBytes(6).toString("hex")}.tmp`
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
readConfig
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-CUTMZWL6.js";
|
|
5
|
+
import {
|
|
6
|
+
assertNoStdinPlaceholder
|
|
7
|
+
} from "./chunk-ZYURL5VK.js";
|
|
5
8
|
|
|
6
9
|
// src/lib/resolve.ts
|
|
7
10
|
var DEFAULT_BASE_URL = "https://api.curviate.com";
|
|
@@ -20,9 +23,28 @@ async function resolveEffectiveConfig(flags) {
|
|
|
20
23
|
|
|
21
24
|
// src/lib/client.ts
|
|
22
25
|
import { Curviate } from "@curviate/sdk";
|
|
26
|
+
function headerStrings(headers) {
|
|
27
|
+
if (!headers) return [];
|
|
28
|
+
if (headers instanceof Headers) {
|
|
29
|
+
const out = [];
|
|
30
|
+
headers.forEach((value, key) => out.push(key, value));
|
|
31
|
+
return out;
|
|
32
|
+
}
|
|
33
|
+
if (Array.isArray(headers)) return headers.flat().map(String);
|
|
34
|
+
return Object.entries(headers).flat().map(String);
|
|
35
|
+
}
|
|
36
|
+
var guardedFetch = (input, init) => {
|
|
37
|
+
assertNoStdinPlaceholder("the request about to be sent", [
|
|
38
|
+
String(input instanceof Request ? input.url : input),
|
|
39
|
+
...headerStrings(init?.headers),
|
|
40
|
+
typeof init?.body === "string" ? init.body : void 0
|
|
41
|
+
]);
|
|
42
|
+
return fetch(input, init);
|
|
43
|
+
};
|
|
23
44
|
function createClient(config) {
|
|
24
45
|
return new Curviate({
|
|
25
46
|
apiKey: config.apiKey.trim(),
|
|
47
|
+
fetch: guardedFetch,
|
|
26
48
|
...config.baseUrl !== void 0 ? { baseUrl: config.baseUrl } : {},
|
|
27
49
|
...config.timeout !== void 0 ? { timeout: config.timeout } : {}
|
|
28
50
|
});
|
|
@@ -3,9 +3,6 @@ import {
|
|
|
3
3
|
looksLikeCommandWord,
|
|
4
4
|
nearestSubcommand
|
|
5
5
|
} from "./chunk-HOQ7EUHJ.js";
|
|
6
|
-
import {
|
|
7
|
-
resolveTextOrStdin
|
|
8
|
-
} from "./chunk-U7Y4EXHT.js";
|
|
9
6
|
import {
|
|
10
7
|
AttachError,
|
|
11
8
|
readAttachment,
|
|
@@ -28,11 +25,14 @@ import {
|
|
|
28
25
|
renderSuccess,
|
|
29
26
|
renderUnexpectedError,
|
|
30
27
|
resolveEffectiveConfig
|
|
31
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-LMVDURUZ.js";
|
|
32
29
|
import {
|
|
33
30
|
READ_SINGLE_FLAGS,
|
|
34
31
|
WRITE_FLAGS
|
|
35
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-CUTMZWL6.js";
|
|
33
|
+
import {
|
|
34
|
+
resolveTextOrStdin
|
|
35
|
+
} from "./chunk-ZYURL5VK.js";
|
|
36
36
|
|
|
37
37
|
// src/commands/message.ts
|
|
38
38
|
import { defineCommand } from "citty";
|
|
@@ -393,7 +393,7 @@ var messageNewCommand = defineCommand({
|
|
|
393
393
|
description: "Recipient: LinkedIn profile URL (e.g. https://www.linkedin.com/in/some-slug), bare slug (e.g. some-slug), or provider ID (e.g. ACoAAA\u2026). URL and slug inputs resolve the provider ID automatically.",
|
|
394
394
|
required: true
|
|
395
395
|
},
|
|
396
|
-
text: { type: "positional", description: "Opening message text. Pass - to read from stdin (e.g. via heredoc or pipe)." },
|
|
396
|
+
text: { type: "positional", stdinArg: true, description: "Opening message text. Pass - to read from stdin (e.g. via heredoc or pipe)." },
|
|
397
397
|
attach: { type: "string", description: "File to attach (repeatable)." }
|
|
398
398
|
},
|
|
399
399
|
async run({ args }) {
|
|
@@ -447,7 +447,7 @@ var messageEditCommand = defineCommand({
|
|
|
447
447
|
...WRITE_FLAGS,
|
|
448
448
|
chatId: { type: "positional", description: "Chat ID or LinkedIn messaging thread URL." },
|
|
449
449
|
messageId: { type: "positional", description: "Message ID." },
|
|
450
|
-
text: { type: "positional", description: "Replacement text. Pass - to read from stdin." }
|
|
450
|
+
text: { type: "positional", stdinArg: true, description: "Replacement text. Pass - to read from stdin." }
|
|
451
451
|
},
|
|
452
452
|
async run({ args }) {
|
|
453
453
|
const flags = args;
|
|
@@ -569,7 +569,7 @@ var messageInMailCommand = defineCommand({
|
|
|
569
569
|
required: true
|
|
570
570
|
},
|
|
571
571
|
subject: { type: "string", description: "InMail subject line.", required: true },
|
|
572
|
-
text: { type: "positional", description: "InMail body text. Pass - to read from stdin." }
|
|
572
|
+
text: { type: "positional", stdinArg: true, description: "InMail body text. Pass - to read from stdin." }
|
|
573
573
|
},
|
|
574
574
|
async run({ args }) {
|
|
575
575
|
const flags = args;
|
|
@@ -601,7 +601,7 @@ var messageSendCommand = defineCommand({
|
|
|
601
601
|
type: "positional",
|
|
602
602
|
description: "Chat ID or LinkedIn messaging thread URL. A COMPANY_ chat id sends as the company page; any other chat id sends as the connected member."
|
|
603
603
|
},
|
|
604
|
-
text: { type: "positional", description: "Message text. Pass - to read from stdin (e.g. via heredoc or pipe)." },
|
|
604
|
+
text: { type: "positional", stdinArg: true, description: "Message text. Pass - to read from stdin (e.g. via heredoc or pipe)." },
|
|
605
605
|
attach: { type: "string", description: "File to attach (repeatable)." }
|
|
606
606
|
},
|
|
607
607
|
async run({ args }) {
|
|
@@ -691,7 +691,7 @@ var messageCommand = defineCommand({
|
|
|
691
691
|
description: "Chat ID to send a message to. A COMPANY_ chat id sends as the company page.",
|
|
692
692
|
required: false
|
|
693
693
|
},
|
|
694
|
-
text: { type: "positional", description: "Message text. Pass - to read from stdin.", required: false },
|
|
694
|
+
text: { type: "positional", stdinArg: true, description: "Message text. Pass - to read from stdin.", required: false },
|
|
695
695
|
attach: { type: "string", description: "File to attach (repeatable)." }
|
|
696
696
|
},
|
|
697
697
|
subCommands: {
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
// src/lib/stdin.ts
|
|
4
|
+
var STDIN_SENTINEL = "__curviate_stdin__";
|
|
5
|
+
async function defaultReadStdin() {
|
|
6
|
+
return new Promise((resolve, reject) => {
|
|
7
|
+
const chunks = [];
|
|
8
|
+
process.stdin.on("data", (chunk) => {
|
|
9
|
+
chunks.push(Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk));
|
|
10
|
+
});
|
|
11
|
+
process.stdin.on("end", () => {
|
|
12
|
+
const full = Buffer.concat(chunks).toString("utf8");
|
|
13
|
+
resolve(full.replace(/\n+$/, ""));
|
|
14
|
+
});
|
|
15
|
+
process.stdin.on("error", reject);
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
function isStdinToken(value) {
|
|
19
|
+
return value === "-" || value === STDIN_SENTINEL;
|
|
20
|
+
}
|
|
21
|
+
function declaresStdinArg(def) {
|
|
22
|
+
return def?.stdinArg === true;
|
|
23
|
+
}
|
|
24
|
+
function restoreLiteralDashes(args, argsDef) {
|
|
25
|
+
const declaring = /* @__PURE__ */ new Set();
|
|
26
|
+
const positionalNames = [];
|
|
27
|
+
for (const [name, def] of Object.entries(argsDef)) {
|
|
28
|
+
if (def?.type === "positional") positionalNames.push(name);
|
|
29
|
+
if (!declaresStdinArg(def)) continue;
|
|
30
|
+
declaring.add(name);
|
|
31
|
+
const alias = def.alias;
|
|
32
|
+
if (typeof alias === "string") declaring.add(alias);
|
|
33
|
+
else if (Array.isArray(alias)) for (const a of alias) declaring.add(a);
|
|
34
|
+
}
|
|
35
|
+
const put = (value) => {
|
|
36
|
+
if (value === STDIN_SENTINEL) return "-";
|
|
37
|
+
if (Array.isArray(value)) return value.map((e) => e === STDIN_SENTINEL ? "-" : e);
|
|
38
|
+
return value;
|
|
39
|
+
};
|
|
40
|
+
for (const key of Object.keys(args)) {
|
|
41
|
+
if (key === "_" || declaring.has(key)) continue;
|
|
42
|
+
args[key] = put(args[key]);
|
|
43
|
+
}
|
|
44
|
+
const rest = args["_"];
|
|
45
|
+
if (Array.isArray(rest)) {
|
|
46
|
+
for (let i = 0; i < rest.length; i++) {
|
|
47
|
+
const name = positionalNames[i];
|
|
48
|
+
if (name !== void 0 && declaring.has(name)) continue;
|
|
49
|
+
if (rest[i] === STDIN_SENTINEL) rest[i] = "-";
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
function assertNoStdinPlaceholder(where, values) {
|
|
54
|
+
if (!values.some((v) => typeof v === "string" && v.includes(STDIN_SENTINEL))) return;
|
|
55
|
+
process.stderr.write(
|
|
56
|
+
`error: refusing to continue. ${where} contains "${STDIN_SENTINEL}", the internal placeholder the CLI substitutes for a bare "-" while it parses arguments.
|
|
57
|
+
`
|
|
58
|
+
);
|
|
59
|
+
process.stderr.write(
|
|
60
|
+
`hint: that placeholder means "read this value from stdin" and must never leave the process. Check the value you supplied, including environment variables such as CURVIATE_ACCOUNT and CURVIATE_API_KEY. If you did not supply it yourself, this is a bug in the CLI. Nothing was sent or written.
|
|
61
|
+
`
|
|
62
|
+
);
|
|
63
|
+
process.exit(1);
|
|
64
|
+
}
|
|
65
|
+
async function resolveTextOrStdin(rawText, out, readStdin) {
|
|
66
|
+
if (!isStdinToken(rawText)) return rawText;
|
|
67
|
+
const reader = readStdin ?? defaultReadStdin;
|
|
68
|
+
const text = await reader();
|
|
69
|
+
if (!text) {
|
|
70
|
+
out.stderr.write("error: stdin: empty input\n");
|
|
71
|
+
process.exit(2);
|
|
72
|
+
}
|
|
73
|
+
return text;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export {
|
|
77
|
+
STDIN_SENTINEL,
|
|
78
|
+
defaultReadStdin,
|
|
79
|
+
isStdinToken,
|
|
80
|
+
restoreLiteralDashes,
|
|
81
|
+
assertNoStdinPlaceholder,
|
|
82
|
+
resolveTextOrStdin
|
|
83
|
+
};
|
package/dist/cli.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
|
-
STDIN_SENTINEL
|
|
4
|
-
|
|
3
|
+
STDIN_SENTINEL,
|
|
4
|
+
restoreLiteralDashes
|
|
5
|
+
} from "./chunk-ZYURL5VK.js";
|
|
5
6
|
|
|
6
7
|
// src/cli.ts
|
|
7
8
|
import { defineCommand } from "citty";
|
|
@@ -221,7 +222,21 @@ async function dispatch(root, rawArgs) {
|
|
|
221
222
|
usageError(`unknown flag \`${unknown}\`.`);
|
|
222
223
|
}
|
|
223
224
|
const processedLeafArgs = leafArgs.map((a) => a === "-" ? STDIN_SENTINEL : a);
|
|
224
|
-
const
|
|
225
|
+
const leafArgsDef = await resolveValue(leaf.args ?? {});
|
|
226
|
+
const originalRun = leaf.run;
|
|
227
|
+
const leafToRun = {
|
|
228
|
+
...leaf,
|
|
229
|
+
subCommands: void 0,
|
|
230
|
+
...originalRun ? {
|
|
231
|
+
run: (ctx) => {
|
|
232
|
+
restoreLiteralDashes(
|
|
233
|
+
ctx.args,
|
|
234
|
+
leafArgsDef
|
|
235
|
+
);
|
|
236
|
+
return originalRun(ctx);
|
|
237
|
+
}
|
|
238
|
+
} : {}
|
|
239
|
+
};
|
|
225
240
|
await runCommand(leafToRun, { rawArgs: processedLeafArgs });
|
|
226
241
|
} catch (err) {
|
|
227
242
|
const message = err instanceof Error ? err.message : String(err);
|
|
@@ -247,28 +262,28 @@ var main = defineCommand({
|
|
|
247
262
|
// Subcommand registry — names and descriptions are static for help rendering;
|
|
248
263
|
// the handler implementation is loaded lazily on first invocation.
|
|
249
264
|
subCommands: {
|
|
250
|
-
login: () => import("./login-
|
|
251
|
-
config: () => import("./config-
|
|
265
|
+
login: () => import("./login-ZLDDIAFW.js").then((m) => m.loginCommand),
|
|
266
|
+
config: () => import("./config-FPWWYG7G.js").then((m) => m.configCommand),
|
|
252
267
|
// ---------------------------------------------------------------------------
|
|
253
268
|
// Noun groups — lazy-loaded on first invocation.
|
|
254
269
|
// ---------------------------------------------------------------------------
|
|
255
|
-
profile: () => import("./profile-
|
|
256
|
-
company: () => import("./company-
|
|
257
|
-
job: () => import("./job-
|
|
258
|
-
connect: () => import("./connect-
|
|
259
|
-
search: () => import("./search-
|
|
260
|
-
inbox: () => import("./inbox-
|
|
261
|
-
inboxes: () => import("./inboxes-
|
|
262
|
-
message: () => import("./message-
|
|
263
|
-
post: () => import("./post-
|
|
264
|
-
comment: () => import("./comment-
|
|
265
|
-
account: () => import("./account-
|
|
266
|
-
webhook: () => import("./webhook-
|
|
267
|
-
"sales-nav": () => import("./sales-nav-
|
|
268
|
-
recruiter: () => import("./recruiter-
|
|
269
|
-
group: () => import("./group-
|
|
270
|
-
feed: () => import("./feed-
|
|
271
|
-
notification: () => import("./notification-
|
|
270
|
+
profile: () => import("./profile-XOMDIYSY.js").then((m) => m.profileCommand),
|
|
271
|
+
company: () => import("./company-DFJK2RHM.js").then((m) => m.companyCommand),
|
|
272
|
+
job: () => import("./job-WOPIAHOR.js").then((m) => m.jobCommand),
|
|
273
|
+
connect: () => import("./connect-ELSSMOIC.js").then((m) => m.connectCommand),
|
|
274
|
+
search: () => import("./search-NDESJC3Y.js").then((m) => m.searchCommand),
|
|
275
|
+
inbox: () => import("./inbox-G6KNWWLI.js").then((m) => m.inboxCommand),
|
|
276
|
+
inboxes: () => import("./inboxes-NTTYCQPM.js").then((m) => m.inboxesCommand),
|
|
277
|
+
message: () => import("./message-KJXY5RCD.js").then((m) => m.messageCommand),
|
|
278
|
+
post: () => import("./post-A7YZWBFG.js").then((m) => m.postCommand),
|
|
279
|
+
comment: () => import("./comment-RPLZHFJQ.js").then((m) => m.commentCommand),
|
|
280
|
+
account: () => import("./account-A3FOYUKC.js").then((m) => m.accountCommand),
|
|
281
|
+
webhook: () => import("./webhook-TNZF3FMN.js").then((m) => m.webhookCommand),
|
|
282
|
+
"sales-nav": () => import("./sales-nav-5ZRE2UAQ.js").then((m) => m.salesNavCommand),
|
|
283
|
+
recruiter: () => import("./recruiter-CCLG4PM4.js").then((m) => m.recruiterCommand),
|
|
284
|
+
group: () => import("./group-52MP24W3.js").then((m) => m.groupCommand),
|
|
285
|
+
feed: () => import("./feed-23Z7OQNL.js").then((m) => m.feedCommand),
|
|
286
|
+
notification: () => import("./notification-MNEABNVW.js").then((m) => m.notificationCommand)
|
|
272
287
|
},
|
|
273
288
|
async run() {
|
|
274
289
|
const { runMain } = await import("citty");
|
|
@@ -2,9 +2,6 @@
|
|
|
2
2
|
import {
|
|
3
3
|
resolveMemberOrMeProviderId
|
|
4
4
|
} from "./chunk-QJZ3LWOX.js";
|
|
5
|
-
import {
|
|
6
|
-
resolveTextOrStdin
|
|
7
|
-
} from "./chunk-U7Y4EXHT.js";
|
|
8
5
|
import {
|
|
9
6
|
AttachError,
|
|
10
7
|
describeAttachment,
|
|
@@ -25,11 +22,14 @@ import {
|
|
|
25
22
|
renderSuccess,
|
|
26
23
|
renderUnexpectedError,
|
|
27
24
|
resolveEffectiveConfig
|
|
28
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-LMVDURUZ.js";
|
|
29
26
|
import {
|
|
30
27
|
GLOBAL_FLAGS,
|
|
31
28
|
WRITE_SINGLE_FLAGS
|
|
32
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-CUTMZWL6.js";
|
|
30
|
+
import {
|
|
31
|
+
resolveTextOrStdin
|
|
32
|
+
} from "./chunk-ZYURL5VK.js";
|
|
33
33
|
|
|
34
34
|
// src/commands/comment.ts
|
|
35
35
|
import { defineCommand } from "citty";
|
|
@@ -452,7 +452,7 @@ var commentAddCommand = defineCommand({
|
|
|
452
452
|
args: {
|
|
453
453
|
...WRITE_SINGLE_FLAGS,
|
|
454
454
|
postId: { type: "positional", description: "Post id to comment on." },
|
|
455
|
-
text: { type: "positional", description: "Comment text. Pass - to read from stdin." },
|
|
455
|
+
text: { type: "positional", stdinArg: true, description: "Comment text. Pass - to read from stdin." },
|
|
456
456
|
attach: { type: "string", description: "Image file to attach (at most one)." }
|
|
457
457
|
},
|
|
458
458
|
async run({ args }) {
|
|
@@ -465,7 +465,7 @@ var commentReplyCommand = defineCommand({
|
|
|
465
465
|
...WRITE_SINGLE_FLAGS,
|
|
466
466
|
postId: { type: "positional", description: "Post id the comment belongs to." },
|
|
467
467
|
commentId: { type: "positional", description: "Comment id to reply to." },
|
|
468
|
-
text: { type: "positional", description: "Reply text. Pass - to read from stdin." },
|
|
468
|
+
text: { type: "positional", stdinArg: true, description: "Reply text. Pass - to read from stdin." },
|
|
469
469
|
attach: { type: "string", description: "Image file to attach (at most one)." }
|
|
470
470
|
},
|
|
471
471
|
async run({ args }) {
|
|
@@ -478,7 +478,7 @@ var commentEditCommand = defineCommand({
|
|
|
478
478
|
...WRITE_SINGLE_FLAGS,
|
|
479
479
|
postId: { type: "positional", description: "Post id the comment belongs to." },
|
|
480
480
|
commentId: { type: "positional", description: "Comment id to edit." },
|
|
481
|
-
text: { type: "positional", description: "Updated comment text. Pass - to read from stdin." }
|
|
481
|
+
text: { type: "positional", stdinArg: true, description: "Updated comment text. Pass - to read from stdin." }
|
|
482
482
|
},
|
|
483
483
|
async run({ args }) {
|
|
484
484
|
await withClient(args, (c, f, o) => runCommentEdit(c, f, o, void 0));
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
sentAsNotice
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-Q7XG2VIF.js";
|
|
5
5
|
import "./chunk-HOQ7EUHJ.js";
|
|
6
|
-
import {
|
|
7
|
-
resolveTextOrStdin
|
|
8
|
-
} from "./chunk-U7Y4EXHT.js";
|
|
9
6
|
import {
|
|
10
7
|
AttachError,
|
|
11
8
|
readAttachment,
|
|
@@ -37,11 +34,14 @@ import {
|
|
|
37
34
|
renderSuccess,
|
|
38
35
|
renderUnexpectedError,
|
|
39
36
|
resolveEffectiveConfig
|
|
40
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-LMVDURUZ.js";
|
|
41
38
|
import {
|
|
42
39
|
GLOBAL_FLAGS,
|
|
43
40
|
WRITE_FLAGS
|
|
44
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-CUTMZWL6.js";
|
|
42
|
+
import {
|
|
43
|
+
resolveTextOrStdin
|
|
44
|
+
} from "./chunk-ZYURL5VK.js";
|
|
45
45
|
|
|
46
46
|
// src/commands/company.ts
|
|
47
47
|
import { defineCommand } from "citty";
|
|
@@ -824,7 +824,7 @@ var companyReplyCommand = defineCommand({
|
|
|
824
824
|
type: "positional",
|
|
825
825
|
description: "The 2-\u2026 chat id from `company chats`, passed through verbatim (no client-side check)."
|
|
826
826
|
},
|
|
827
|
-
text: { type: "positional", description: "Reply text. Pass - to read from stdin (e.g. via heredoc or pipe)." },
|
|
827
|
+
text: { type: "positional", stdinArg: true, description: "Reply text. Pass - to read from stdin (e.g. via heredoc or pipe)." },
|
|
828
828
|
attach: { type: "string", description: "File to attach (repeatable)." }
|
|
829
829
|
},
|
|
830
830
|
async run({ args }) {
|
|
@@ -24,11 +24,12 @@ import {
|
|
|
24
24
|
renderSuccess,
|
|
25
25
|
renderUnexpectedError,
|
|
26
26
|
resolveEffectiveConfig
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-LMVDURUZ.js";
|
|
28
28
|
import {
|
|
29
29
|
GLOBAL_FLAGS,
|
|
30
30
|
WRITE_FLAGS
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-CUTMZWL6.js";
|
|
32
|
+
import "./chunk-ZYURL5VK.js";
|
|
32
33
|
|
|
33
34
|
// src/commands/connect.ts
|
|
34
35
|
import { defineCommand } from "citty";
|
|
@@ -9,10 +9,11 @@ import {
|
|
|
9
9
|
renderSuccess,
|
|
10
10
|
renderUnexpectedError,
|
|
11
11
|
resolveEffectiveConfig
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-LMVDURUZ.js";
|
|
13
13
|
import {
|
|
14
14
|
GLOBAL_FLAGS
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-CUTMZWL6.js";
|
|
16
|
+
import "./chunk-ZYURL5VK.js";
|
|
16
17
|
|
|
17
18
|
// src/commands/feed.ts
|
|
18
19
|
import { defineCommand } from "citty";
|
|
@@ -9,11 +9,12 @@ import {
|
|
|
9
9
|
renderSuccess,
|
|
10
10
|
renderUnexpectedError,
|
|
11
11
|
resolveEffectiveConfig
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-LMVDURUZ.js";
|
|
13
13
|
import {
|
|
14
14
|
GLOBAL_FLAGS,
|
|
15
15
|
READ_SINGLE_FLAGS
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-CUTMZWL6.js";
|
|
17
|
+
import "./chunk-ZYURL5VK.js";
|
|
17
18
|
|
|
18
19
|
// src/commands/group.ts
|
|
19
20
|
import { defineCommand } from "citty";
|
|
@@ -15,12 +15,13 @@ import {
|
|
|
15
15
|
renderSuccess,
|
|
16
16
|
renderUnexpectedError,
|
|
17
17
|
resolveEffectiveConfig
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-LMVDURUZ.js";
|
|
19
19
|
import {
|
|
20
20
|
GLOBAL_FLAGS,
|
|
21
21
|
READ_SINGLE_FLAGS,
|
|
22
22
|
WRITE_SINGLE_FLAGS
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-CUTMZWL6.js";
|
|
24
|
+
import "./chunk-ZYURL5VK.js";
|
|
24
25
|
|
|
25
26
|
// src/commands/inbox.ts
|
|
26
27
|
import { defineCommand } from "citty";
|
|
@@ -9,11 +9,12 @@ import {
|
|
|
9
9
|
renderSuccess,
|
|
10
10
|
renderUnexpectedError,
|
|
11
11
|
resolveEffectiveConfig
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-LMVDURUZ.js";
|
|
13
13
|
import {
|
|
14
14
|
GLOBAL_FLAGS,
|
|
15
15
|
READ_SINGLE_FLAGS
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-CUTMZWL6.js";
|
|
17
|
+
import "./chunk-ZYURL5VK.js";
|
|
17
18
|
|
|
18
19
|
// src/commands/inboxes.ts
|
|
19
20
|
import { defineCommand } from "citty";
|
|
@@ -24,12 +24,13 @@ import {
|
|
|
24
24
|
renderSuccess,
|
|
25
25
|
renderUnexpectedError,
|
|
26
26
|
resolveEffectiveConfig
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-LMVDURUZ.js";
|
|
28
28
|
import {
|
|
29
29
|
GLOBAL_FLAGS,
|
|
30
30
|
READ_SINGLE_FLAGS,
|
|
31
31
|
WRITE_SINGLE_FLAGS
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-CUTMZWL6.js";
|
|
33
|
+
import "./chunk-ZYURL5VK.js";
|
|
33
34
|
|
|
34
35
|
// src/commands/job.ts
|
|
35
36
|
import { defineCommand } from "citty";
|
|
@@ -5,7 +5,11 @@ import {
|
|
|
5
5
|
import {
|
|
6
6
|
GLOBAL_FLAGS,
|
|
7
7
|
writeProfile
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-CUTMZWL6.js";
|
|
9
|
+
import {
|
|
10
|
+
defaultReadStdin,
|
|
11
|
+
resolveTextOrStdin
|
|
12
|
+
} from "./chunk-ZYURL5VK.js";
|
|
9
13
|
|
|
10
14
|
// src/commands/login.ts
|
|
11
15
|
import { defineCommand } from "citty";
|
|
@@ -43,6 +47,7 @@ var loginCommand = defineCommand({
|
|
|
43
47
|
...GLOBAL_FLAGS,
|
|
44
48
|
"api-key": {
|
|
45
49
|
type: "string",
|
|
50
|
+
stdinArg: true,
|
|
46
51
|
description: 'API key to save. Pass "-" to read from stdin (keeps the key off argv).'
|
|
47
52
|
},
|
|
48
53
|
account: {
|
|
@@ -58,8 +63,13 @@ var loginCommand = defineCommand({
|
|
|
58
63
|
async run({ args }) {
|
|
59
64
|
const profileName = args.profile ?? "default";
|
|
60
65
|
let apiKey = args["api-key"];
|
|
61
|
-
|
|
62
|
-
|
|
66
|
+
const out = { stderr: { write: (s) => process.stderr.write(s) } };
|
|
67
|
+
if (apiKey !== void 0) {
|
|
68
|
+
apiKey = await resolveTextOrStdin(
|
|
69
|
+
apiKey,
|
|
70
|
+
out,
|
|
71
|
+
async () => (await defaultReadStdin()).trim()
|
|
72
|
+
);
|
|
63
73
|
}
|
|
64
74
|
if (apiKey === void 0) {
|
|
65
75
|
if (process.stdin.isTTY) {
|
|
@@ -72,7 +82,6 @@ var loginCommand = defineCommand({
|
|
|
72
82
|
return;
|
|
73
83
|
}
|
|
74
84
|
}
|
|
75
|
-
const out = { stderr: { write: (s) => process.stderr.write(s) } };
|
|
76
85
|
await runLogin(
|
|
77
86
|
{
|
|
78
87
|
"api-key": apiKey,
|
|
@@ -84,16 +93,6 @@ var loginCommand = defineCommand({
|
|
|
84
93
|
);
|
|
85
94
|
}
|
|
86
95
|
});
|
|
87
|
-
async function readStdin() {
|
|
88
|
-
return new Promise((resolve, reject) => {
|
|
89
|
-
const chunks = [];
|
|
90
|
-
process.stdin.on("data", (chunk) => chunks.push(chunk));
|
|
91
|
-
process.stdin.on("end", () => {
|
|
92
|
-
resolve(Buffer.concat(chunks).toString("utf8").trim());
|
|
93
|
-
});
|
|
94
|
-
process.stdin.on("error", reject);
|
|
95
|
-
});
|
|
96
|
-
}
|
|
97
96
|
async function promptMasked(prompt) {
|
|
98
97
|
return readlineSync(prompt, { mask: true });
|
|
99
98
|
}
|
|
@@ -13,15 +13,15 @@ import {
|
|
|
13
13
|
runMessageSend,
|
|
14
14
|
sentAsNotice,
|
|
15
15
|
willSendAsNotice
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-Q7XG2VIF.js";
|
|
17
17
|
import "./chunk-HOQ7EUHJ.js";
|
|
18
|
-
import "./chunk-U7Y4EXHT.js";
|
|
19
18
|
import "./chunk-BGZW6B7G.js";
|
|
20
19
|
import "./chunk-UWO2D4HW.js";
|
|
21
20
|
import "./chunk-DMQZEPQE.js";
|
|
22
21
|
import "./chunk-R3VLWLVV.js";
|
|
23
|
-
import "./chunk-
|
|
24
|
-
import "./chunk-
|
|
22
|
+
import "./chunk-LMVDURUZ.js";
|
|
23
|
+
import "./chunk-CUTMZWL6.js";
|
|
24
|
+
import "./chunk-ZYURL5VK.js";
|
|
25
25
|
export {
|
|
26
26
|
guardBareMessageForm,
|
|
27
27
|
messageCommand,
|
|
@@ -12,11 +12,12 @@ import {
|
|
|
12
12
|
renderSuccess,
|
|
13
13
|
renderUnexpectedError,
|
|
14
14
|
resolveEffectiveConfig
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-LMVDURUZ.js";
|
|
16
16
|
import {
|
|
17
17
|
GLOBAL_FLAGS,
|
|
18
18
|
WRITE_SINGLE_FLAGS
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-CUTMZWL6.js";
|
|
20
|
+
import "./chunk-ZYURL5VK.js";
|
|
20
21
|
|
|
21
22
|
// src/commands/notification.ts
|
|
22
23
|
import { defineCommand } from "citty";
|
|
@@ -2,9 +2,6 @@
|
|
|
2
2
|
import {
|
|
3
3
|
resolveMemberOrMeProviderId
|
|
4
4
|
} from "./chunk-QJZ3LWOX.js";
|
|
5
|
-
import {
|
|
6
|
-
resolveTextOrStdin
|
|
7
|
-
} from "./chunk-U7Y4EXHT.js";
|
|
8
5
|
import {
|
|
9
6
|
AttachError,
|
|
10
7
|
readAttachment,
|
|
@@ -24,12 +21,15 @@ import {
|
|
|
24
21
|
renderSuccess,
|
|
25
22
|
renderUnexpectedError,
|
|
26
23
|
resolveEffectiveConfig
|
|
27
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-LMVDURUZ.js";
|
|
28
25
|
import {
|
|
29
26
|
GLOBAL_FLAGS,
|
|
30
27
|
WRITE_FLAGS,
|
|
31
28
|
WRITE_SINGLE_FLAGS
|
|
32
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-CUTMZWL6.js";
|
|
30
|
+
import {
|
|
31
|
+
resolveTextOrStdin
|
|
32
|
+
} from "./chunk-ZYURL5VK.js";
|
|
33
33
|
|
|
34
34
|
// src/commands/post.ts
|
|
35
35
|
import { defineCommand } from "citty";
|
|
@@ -412,7 +412,7 @@ var postCreateCommand = defineCommand({
|
|
|
412
412
|
args: {
|
|
413
413
|
// Write command: WRITE_FLAGS omits pagination/projection flags
|
|
414
414
|
...WRITE_FLAGS,
|
|
415
|
-
text: { type: "positional", description: "Post body text. Pass - to read from stdin (enables multiline via heredoc or pipe)." },
|
|
415
|
+
text: { type: "positional", stdinArg: true, description: "Post body text. Pass - to read from stdin (enables multiline via heredoc or pipe)." },
|
|
416
416
|
attach: {
|
|
417
417
|
type: "string",
|
|
418
418
|
description: "Image/video/document to attach (repeatable for images; a single PDF produces a document post). Supported: jpg, png, gif, mp4, pdf."
|
|
@@ -28,12 +28,13 @@ import {
|
|
|
28
28
|
renderSuccess,
|
|
29
29
|
renderUnexpectedError,
|
|
30
30
|
resolveEffectiveConfig
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-LMVDURUZ.js";
|
|
32
32
|
import {
|
|
33
33
|
GLOBAL_FLAGS,
|
|
34
34
|
READ_SINGLE_FLAGS,
|
|
35
35
|
WRITE_SINGLE_FLAGS
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-CUTMZWL6.js";
|
|
37
|
+
import "./chunk-ZYURL5VK.js";
|
|
37
38
|
|
|
38
39
|
// src/commands/profile.ts
|
|
39
40
|
import { defineCommand } from "citty";
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
DEFAULT_FILTER_READERS,
|
|
4
4
|
assembleFilters,
|
|
5
5
|
splitCsv
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-56ORAZJO.js";
|
|
7
7
|
import {
|
|
8
8
|
AttachError,
|
|
9
9
|
readAttachment,
|
|
@@ -33,13 +33,16 @@ import {
|
|
|
33
33
|
renderSuccess,
|
|
34
34
|
renderUnexpectedError,
|
|
35
35
|
resolveEffectiveConfig
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-LMVDURUZ.js";
|
|
37
37
|
import {
|
|
38
38
|
GLOBAL_FLAGS,
|
|
39
39
|
READ_SINGLE_FLAGS,
|
|
40
40
|
WRITE_FLAGS,
|
|
41
41
|
WRITE_SINGLE_FLAGS
|
|
42
|
-
} from "./chunk-
|
|
42
|
+
} from "./chunk-CUTMZWL6.js";
|
|
43
|
+
import {
|
|
44
|
+
isStdinToken
|
|
45
|
+
} from "./chunk-ZYURL5VK.js";
|
|
43
46
|
|
|
44
47
|
// src/commands/recruiter.ts
|
|
45
48
|
import { defineCommand } from "citty";
|
|
@@ -112,7 +115,7 @@ async function assembleRecruiterJobBody(flags, readers) {
|
|
|
112
115
|
} catch {
|
|
113
116
|
return { error: `cannot read ${source}` };
|
|
114
117
|
}
|
|
115
|
-
} else if (flags.body
|
|
118
|
+
} else if (isStdinToken(flags.body)) {
|
|
116
119
|
source = "--body - (stdin)";
|
|
117
120
|
raw = await readers.readStdin();
|
|
118
121
|
} else if (flags.body !== void 0) {
|
|
@@ -962,7 +965,7 @@ var recruiterSearchPeopleCommand = defineCommand({
|
|
|
962
965
|
args: {
|
|
963
966
|
...GLOBAL_FLAGS,
|
|
964
967
|
keywords: { type: "string", description: "Keyword search string." },
|
|
965
|
-
filters: { type: "string", description: "Filter body as a JSON object (escape hatch for the full filter surface); '-' reads JSON from stdin." },
|
|
968
|
+
filters: { type: "string", stdinArg: true, description: "Filter body as a JSON object (escape hatch for the full filter surface); '-' reads JSON from stdin." },
|
|
966
969
|
"filters-file": { type: "string", description: "Path to a JSON file with the filter body." },
|
|
967
970
|
locale: { type: "string", description: "Result locale, e.g. en." },
|
|
968
971
|
"employment-type": { type: "string", description: "Employment type ids (comma-separated)." },
|
|
@@ -1228,7 +1231,7 @@ var recruiterJobsCommand = defineCommand({
|
|
|
1228
1231
|
});
|
|
1229
1232
|
var RECRUITER_JOB_BODY_FLAGS = {
|
|
1230
1233
|
"body-file": { type: "string", description: "Path to a JSON file with the full job body." },
|
|
1231
|
-
body: { type: "string", description: "Read the JSON job body from stdin (pass '-')." },
|
|
1234
|
+
body: { type: "string", stdinArg: true, description: "Read the JSON job body from stdin (pass '-')." },
|
|
1232
1235
|
"job-title-id": { type: "string", description: "Resolved job-title parameter id (merged with --job-title into job_title:{id,name})." },
|
|
1233
1236
|
"job-title": { type: "string", description: "Job title display name (merged with --job-title-id into job_title:{id,name})." },
|
|
1234
1237
|
"company-id": { type: "string", description: "Resolved company id (or use --company-name for free text)." },
|
|
@@ -1537,7 +1540,7 @@ var recruiterTalentSearchCommand = defineCommand({
|
|
|
1537
1540
|
projectId: { type: "positional", description: "Recruiter project ID." },
|
|
1538
1541
|
"channel-id": { type: "string", description: "The project's RECRUITER_SEARCH talent-pool channel ID (required).", required: true },
|
|
1539
1542
|
keywords: { type: "string", description: "Free-text keyword search." },
|
|
1540
|
-
filters: { type: "string", description: "Filter body as a JSON object (escape hatch for the full filter surface); '-' reads JSON from stdin." },
|
|
1543
|
+
filters: { type: "string", stdinArg: true, description: "Filter body as a JSON object (escape hatch for the full filter surface); '-' reads JSON from stdin." },
|
|
1541
1544
|
"filters-file": { type: "string", description: "Path to a JSON file with the filter body." }
|
|
1542
1545
|
},
|
|
1543
1546
|
async run({ args }) {
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
assembleFilters,
|
|
5
5
|
splitCsv,
|
|
6
6
|
splitCsvNumbers
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-56ORAZJO.js";
|
|
8
8
|
import {
|
|
9
9
|
AttachError,
|
|
10
10
|
readAttachment,
|
|
@@ -26,12 +26,13 @@ import {
|
|
|
26
26
|
renderSuccess,
|
|
27
27
|
renderUnexpectedError,
|
|
28
28
|
resolveEffectiveConfig
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-LMVDURUZ.js";
|
|
30
30
|
import {
|
|
31
31
|
GLOBAL_FLAGS,
|
|
32
32
|
READ_SINGLE_FLAGS,
|
|
33
33
|
WRITE_FLAGS
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-CUTMZWL6.js";
|
|
35
|
+
import "./chunk-ZYURL5VK.js";
|
|
35
36
|
|
|
36
37
|
// src/commands/sales-nav.ts
|
|
37
38
|
import { defineCommand } from "citty";
|
|
@@ -530,7 +531,7 @@ var salesNavSearchPeopleCommand = defineCommand({
|
|
|
530
531
|
args: {
|
|
531
532
|
...GLOBAL_FLAGS,
|
|
532
533
|
keywords: { type: "string", description: "Keyword search string." },
|
|
533
|
-
filters: { type: "string", description: "Filter body as a JSON object (escape hatch for the full filter surface); '-' reads JSON from stdin." },
|
|
534
|
+
filters: { type: "string", stdinArg: true, description: "Filter body as a JSON object (escape hatch for the full filter surface); '-' reads JSON from stdin." },
|
|
534
535
|
"filters-file": { type: "string", description: "Path to a JSON file with the filter body." },
|
|
535
536
|
"first-name": { type: "string", description: "First name to match." },
|
|
536
537
|
"last-name": { type: "string", description: "Last name to match." },
|
|
@@ -560,7 +561,7 @@ var salesNavSearchCompaniesCommand = defineCommand({
|
|
|
560
561
|
args: {
|
|
561
562
|
...GLOBAL_FLAGS,
|
|
562
563
|
keywords: { type: "string", description: "Keyword search string." },
|
|
563
|
-
filters: { type: "string", description: "Filter body as a JSON object (escape hatch for the full filter surface); '-' reads JSON from stdin." },
|
|
564
|
+
filters: { type: "string", stdinArg: true, description: "Filter body as a JSON object (escape hatch for the full filter surface); '-' reads JSON from stdin." },
|
|
564
565
|
"filters-file": { type: "string", description: "Path to a JSON file with the filter body." },
|
|
565
566
|
technologies: { type: "string", description: "Technology tags (comma-separated)." },
|
|
566
567
|
"recent-activities": { type: "string", description: "Recent activity ids (comma-separated)." },
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
assembleFilters,
|
|
5
5
|
splitCsv,
|
|
6
6
|
splitCsvNumbers
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-56ORAZJO.js";
|
|
8
8
|
import {
|
|
9
9
|
slimSearchCompanies,
|
|
10
10
|
slimSearchCompaniesItem,
|
|
@@ -25,10 +25,11 @@ import {
|
|
|
25
25
|
renderSuccess,
|
|
26
26
|
renderUnexpectedError,
|
|
27
27
|
resolveEffectiveConfig
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-LMVDURUZ.js";
|
|
29
29
|
import {
|
|
30
30
|
GLOBAL_FLAGS
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-CUTMZWL6.js";
|
|
32
|
+
import "./chunk-ZYURL5VK.js";
|
|
32
33
|
|
|
33
34
|
// src/commands/search.ts
|
|
34
35
|
import { defineCommand } from "citty";
|
|
@@ -45,6 +46,7 @@ var PEOPLE_INVALID_FLAGS = ["seniority", "function", "employment-type", "sort-by
|
|
|
45
46
|
var FILTER_FLAGS = {
|
|
46
47
|
filters: {
|
|
47
48
|
type: "string",
|
|
49
|
+
stdinArg: true,
|
|
48
50
|
description: "Filter body as a JSON object (named flags win on conflict; server validates and strips unknown fields); '-' reads JSON from stdin."
|
|
49
51
|
},
|
|
50
52
|
"filters-file": {
|
|
@@ -1,8 +1,4 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
STDIN_SENTINEL,
|
|
4
|
-
defaultReadStdin
|
|
5
|
-
} from "./chunk-U7Y4EXHT.js";
|
|
6
2
|
import {
|
|
7
3
|
pageDelayFromFlags,
|
|
8
4
|
streamAll
|
|
@@ -16,10 +12,14 @@ import {
|
|
|
16
12
|
renderSuccess,
|
|
17
13
|
renderUnexpectedError,
|
|
18
14
|
resolveEffectiveConfig
|
|
19
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-LMVDURUZ.js";
|
|
20
16
|
import {
|
|
21
17
|
GLOBAL_FLAGS
|
|
22
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-CUTMZWL6.js";
|
|
19
|
+
import {
|
|
20
|
+
defaultReadStdin,
|
|
21
|
+
isStdinToken
|
|
22
|
+
} from "./chunk-ZYURL5VK.js";
|
|
23
23
|
|
|
24
24
|
// src/commands/webhook.ts
|
|
25
25
|
import { defineCommand } from "citty";
|
|
@@ -216,7 +216,7 @@ async function resolveWebhookBody(raw, out, readStdin = defaultReadStdin) {
|
|
|
216
216
|
);
|
|
217
217
|
process.exit(2);
|
|
218
218
|
}
|
|
219
|
-
if (raw
|
|
219
|
+
if (isStdinToken(raw)) {
|
|
220
220
|
const piped = stripTrailingNewlines(await readStdin());
|
|
221
221
|
if (!piped) {
|
|
222
222
|
out.stderr.write("error: --body -: stdin: empty input\n");
|
|
@@ -428,6 +428,7 @@ var webhookVerifyCommand = defineCommand({
|
|
|
428
428
|
},
|
|
429
429
|
body: {
|
|
430
430
|
type: "string",
|
|
431
|
+
stdinArg: true,
|
|
431
432
|
description: "The raw webhook body: inline JSON, a path to a file containing it, or - to read it from stdin.",
|
|
432
433
|
required: true
|
|
433
434
|
},
|
package/package.json
CHANGED
package/dist/chunk-U7Y4EXHT.js
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
// src/lib/stdin.ts
|
|
4
|
-
var STDIN_SENTINEL = "__curviate_stdin__";
|
|
5
|
-
async function defaultReadStdin() {
|
|
6
|
-
return new Promise((resolve, reject) => {
|
|
7
|
-
const chunks = [];
|
|
8
|
-
process.stdin.on("data", (chunk) => {
|
|
9
|
-
chunks.push(Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk));
|
|
10
|
-
});
|
|
11
|
-
process.stdin.on("end", () => {
|
|
12
|
-
const full = Buffer.concat(chunks).toString("utf8");
|
|
13
|
-
resolve(full.replace(/\n+$/, ""));
|
|
14
|
-
});
|
|
15
|
-
process.stdin.on("error", reject);
|
|
16
|
-
});
|
|
17
|
-
}
|
|
18
|
-
async function resolveTextOrStdin(rawText, out, readStdin) {
|
|
19
|
-
if (rawText !== "-" && rawText !== STDIN_SENTINEL) return rawText;
|
|
20
|
-
const reader = readStdin ?? defaultReadStdin;
|
|
21
|
-
const text = await reader();
|
|
22
|
-
if (!text) {
|
|
23
|
-
out.stderr.write("error: stdin: empty input\n");
|
|
24
|
-
process.exit(2);
|
|
25
|
-
}
|
|
26
|
-
return text;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export {
|
|
30
|
-
STDIN_SENTINEL,
|
|
31
|
-
defaultReadStdin,
|
|
32
|
-
resolveTextOrStdin
|
|
33
|
-
};
|