@curviate/cli 0.9.0 → 0.11.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 +34 -0
- package/README.md +27 -0
- package/dist/account-P5K5UDWF.js +1401 -0
- package/dist/{chunk-TDYIQHQX.js → chunk-4JHGVY7R.js} +3 -1
- package/dist/{chunk-SZB3CFRZ.js → chunk-DMQZEPQE.js} +8 -1
- package/dist/{chunk-47SYFQRF.js → chunk-JXF47TRY.js} +1 -1
- package/dist/chunk-MKXA2LAR.js +51 -0
- package/dist/{exit-codes-NFIR57ZA.js → chunk-OSQ643UW.js} +4 -1
- package/dist/{chunk-P4UYBDCB.js → chunk-SSPILTKF.js} +16 -0
- package/dist/{chunk-CHFKVAEI.js → chunk-U7Y4EXHT.js} +1 -0
- package/dist/cli.js +18 -16
- package/dist/{company-WMO42NXD.js → company-IMAVQBZL.js} +7 -7
- package/dist/{config-2GBLD4GN.js → config-Q2AEWSEC.js} +1 -1
- package/dist/{connect-35ZPFUSM.js → connect-J5NPWKAQ.js} +14 -14
- package/dist/exit-codes-2ASIFXGR.js +11 -0
- package/dist/{inbox-YV6GPRG6.js → inbox-5P5TB6AI.js} +6 -6
- package/dist/job-EIXYBDF6.js +105 -0
- package/dist/{login-POKHNDYX.js → login-BBVQLXM7.js} +4 -49
- package/dist/{message-YRMLMHK7.js → message-646BIYRH.js} +5 -5
- package/dist/{post-KBSR3ADF.js → post-TI6KV26J.js} +7 -7
- package/dist/{profile-5EPEZGUD.js → profile-TUIZZKM7.js} +14 -14
- package/dist/{recruiter-B5UIHTIN.js → recruiter-7K56E2QA.js} +61 -16
- package/dist/{sales-nav-4DYBMHKN.js → sales-nav-I2KMQFFF.js} +13 -13
- package/dist/{search-BRFUS2JW.js → search-TF6OOEUE.js} +8 -8
- package/dist/{webhook-F6CRIISR.js → webhook-VHREWB56.js} +6 -6
- package/package.json +4 -3
- package/dist/account-JCNH2HOR.js +0 -649
|
@@ -208,6 +208,7 @@ var READ_SINGLE_FLAGS = {
|
|
|
208
208
|
preview: GLOBAL_FLAGS.preview,
|
|
209
209
|
verbose: GLOBAL_FLAGS.verbose
|
|
210
210
|
};
|
|
211
|
+
var WRITE_SINGLE_FLAGS = READ_SINGLE_FLAGS;
|
|
211
212
|
|
|
212
213
|
export {
|
|
213
214
|
getConfigPath,
|
|
@@ -219,5 +220,6 @@ export {
|
|
|
219
220
|
updateProfileField,
|
|
220
221
|
GLOBAL_FLAGS,
|
|
221
222
|
WRITE_FLAGS,
|
|
222
|
-
READ_SINGLE_FLAGS
|
|
223
|
+
READ_SINGLE_FLAGS,
|
|
224
|
+
WRITE_SINGLE_FLAGS
|
|
223
225
|
};
|
|
@@ -33,8 +33,15 @@ function normalizeChatId(raw) {
|
|
|
33
33
|
if (match?.[1]) return match[1];
|
|
34
34
|
return raw;
|
|
35
35
|
}
|
|
36
|
+
var JOB_URL_RE = /\/jobs\/view\/(\d+)/;
|
|
37
|
+
function resolveJobIdentifier(raw) {
|
|
38
|
+
const match = JOB_URL_RE.exec(raw);
|
|
39
|
+
if (match?.[1]) return match[1];
|
|
40
|
+
return raw;
|
|
41
|
+
}
|
|
36
42
|
|
|
37
43
|
export {
|
|
38
44
|
resolveIdentifier,
|
|
39
|
-
normalizeChatId
|
|
45
|
+
normalizeChatId,
|
|
46
|
+
resolveJobIdentifier
|
|
40
47
|
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
// src/lib/readline.ts
|
|
4
|
+
import { createInterface } from "readline";
|
|
5
|
+
async function readlineSync(prompt, opts = {}) {
|
|
6
|
+
return new Promise((resolve, reject) => {
|
|
7
|
+
process.stderr.write(prompt);
|
|
8
|
+
if (opts.mask && typeof process.stdin.setRawMode === "function") {
|
|
9
|
+
process.stdin.setRawMode(true);
|
|
10
|
+
process.stdin.resume();
|
|
11
|
+
process.stdin.setEncoding("utf8");
|
|
12
|
+
let input = "";
|
|
13
|
+
const onData = (char) => {
|
|
14
|
+
if (char === "\r" || char === "\n") {
|
|
15
|
+
process.stdin.setRawMode(false);
|
|
16
|
+
process.stdin.pause();
|
|
17
|
+
process.stdin.removeListener("data", onData);
|
|
18
|
+
process.stderr.write("\n");
|
|
19
|
+
resolve(input);
|
|
20
|
+
} else if (char === "") {
|
|
21
|
+
process.stdin.setRawMode(false);
|
|
22
|
+
process.stdin.pause();
|
|
23
|
+
process.stdin.removeListener("data", onData);
|
|
24
|
+
reject(new Error("Interrupted."));
|
|
25
|
+
} else if (char === "\x7F" || char === "\b") {
|
|
26
|
+
input = input.slice(0, -1);
|
|
27
|
+
} else {
|
|
28
|
+
input += char;
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
process.stdin.on("data", onData);
|
|
32
|
+
} else {
|
|
33
|
+
const rl = createInterface({
|
|
34
|
+
input: process.stdin,
|
|
35
|
+
output: void 0,
|
|
36
|
+
// suppress default echo (prompt already on stderr)
|
|
37
|
+
terminal: false
|
|
38
|
+
});
|
|
39
|
+
rl.once("line", (line) => {
|
|
40
|
+
rl.close();
|
|
41
|
+
resolve(line.trim());
|
|
42
|
+
});
|
|
43
|
+
rl.once("error", reject);
|
|
44
|
+
rl.once("close", () => resolve(""));
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export {
|
|
50
|
+
readlineSync
|
|
51
|
+
};
|
|
@@ -209,6 +209,21 @@ function slimAccountGet(data) {
|
|
|
209
209
|
quotas: d["quotas"] ?? []
|
|
210
210
|
};
|
|
211
211
|
}
|
|
212
|
+
function slimJob(data) {
|
|
213
|
+
const d = data !== null && data !== void 0 && typeof data === "object" ? data : {};
|
|
214
|
+
return {
|
|
215
|
+
object: d["object"] ?? null,
|
|
216
|
+
id: d["id"] ?? null,
|
|
217
|
+
title: d["title"] ?? null,
|
|
218
|
+
company: d["company"] ?? null,
|
|
219
|
+
company_id: d["company_id"] ?? null,
|
|
220
|
+
location: d["location"] ?? null,
|
|
221
|
+
state: d["state"] ?? null,
|
|
222
|
+
applicants_counter: d["applicants_counter"] ?? null,
|
|
223
|
+
published_at: d["published_at"] ?? null,
|
|
224
|
+
description: d["description"] ?? null
|
|
225
|
+
};
|
|
226
|
+
}
|
|
212
227
|
function slimCompany(data) {
|
|
213
228
|
const d = data !== null && data !== void 0 && typeof data === "object" ? data : {};
|
|
214
229
|
const rawMessaging = d["messaging"] !== null && d["messaging"] !== void 0 && typeof d["messaging"] === "object" ? d["messaging"] : null;
|
|
@@ -251,5 +266,6 @@ export {
|
|
|
251
266
|
slimAccountListItem,
|
|
252
267
|
slimAccountList,
|
|
253
268
|
slimAccountGet,
|
|
269
|
+
slimJob,
|
|
254
270
|
slimCompany
|
|
255
271
|
};
|
package/dist/cli.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
STDIN_SENTINEL
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-U7Y4EXHT.js";
|
|
5
5
|
|
|
6
6
|
// src/cli.ts
|
|
7
7
|
import { defineCommand } from "citty";
|
|
@@ -42,9 +42,10 @@ function findUnknownFlag(rawArgs, declared) {
|
|
|
42
42
|
let name = arg.replace(/^-+/, "");
|
|
43
43
|
const eq = name.indexOf("=");
|
|
44
44
|
if (eq !== -1) name = name.slice(0, eq);
|
|
45
|
-
if (name.startsWith("no-")) name = name.slice(3);
|
|
46
45
|
if (name === "") continue;
|
|
47
|
-
if (
|
|
46
|
+
if (declared.has(name)) continue;
|
|
47
|
+
if (name.startsWith("no-") && declared.has(name.slice(3))) continue;
|
|
48
|
+
return arg;
|
|
48
49
|
}
|
|
49
50
|
return null;
|
|
50
51
|
}
|
|
@@ -138,22 +139,23 @@ var main = defineCommand({
|
|
|
138
139
|
// Subcommand registry — names and descriptions are static for help rendering;
|
|
139
140
|
// the handler implementation is loaded lazily on first invocation.
|
|
140
141
|
subCommands: {
|
|
141
|
-
login: () => import("./login-
|
|
142
|
-
config: () => import("./config-
|
|
142
|
+
login: () => import("./login-BBVQLXM7.js").then((m) => m.loginCommand),
|
|
143
|
+
config: () => import("./config-Q2AEWSEC.js").then((m) => m.configCommand),
|
|
143
144
|
// ---------------------------------------------------------------------------
|
|
144
145
|
// Noun groups — lazy-loaded on first invocation.
|
|
145
146
|
// ---------------------------------------------------------------------------
|
|
146
|
-
profile: () => import("./profile-
|
|
147
|
-
company: () => import("./company-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
147
|
+
profile: () => import("./profile-TUIZZKM7.js").then((m) => m.profileCommand),
|
|
148
|
+
company: () => import("./company-IMAVQBZL.js").then((m) => m.companyCommand),
|
|
149
|
+
job: () => import("./job-EIXYBDF6.js").then((m) => m.jobCommand),
|
|
150
|
+
connect: () => import("./connect-J5NPWKAQ.js").then((m) => m.connectCommand),
|
|
151
|
+
search: () => import("./search-TF6OOEUE.js").then((m) => m.searchCommand),
|
|
152
|
+
inbox: () => import("./inbox-5P5TB6AI.js").then((m) => m.inboxCommand),
|
|
153
|
+
message: () => import("./message-646BIYRH.js").then((m) => m.messageCommand),
|
|
154
|
+
post: () => import("./post-TI6KV26J.js").then((m) => m.postCommand),
|
|
155
|
+
account: () => import("./account-P5K5UDWF.js").then((m) => m.accountCommand),
|
|
156
|
+
webhook: () => import("./webhook-VHREWB56.js").then((m) => m.webhookCommand),
|
|
157
|
+
"sales-nav": () => import("./sales-nav-I2KMQFFF.js").then((m) => m.salesNavCommand),
|
|
158
|
+
recruiter: () => import("./recruiter-7K56E2QA.js").then((m) => m.recruiterCommand)
|
|
157
159
|
},
|
|
158
160
|
async run() {
|
|
159
161
|
const { runMain } = await import("citty");
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
resolveIdentifier
|
|
4
|
-
} from "./chunk-SZB3CFRZ.js";
|
|
5
2
|
import {
|
|
6
3
|
slimCompany
|
|
7
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-SSPILTKF.js";
|
|
5
|
+
import {
|
|
6
|
+
resolveIdentifier
|
|
7
|
+
} from "./chunk-DMQZEPQE.js";
|
|
8
8
|
import {
|
|
9
9
|
createClient,
|
|
10
10
|
renderError,
|
|
11
11
|
renderSuccess,
|
|
12
12
|
renderUnexpectedError,
|
|
13
13
|
resolveEffectiveConfig
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-JXF47TRY.js";
|
|
15
15
|
import {
|
|
16
16
|
GLOBAL_FLAGS
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-4JHGVY7R.js";
|
|
18
18
|
|
|
19
19
|
// src/commands/company.ts
|
|
20
20
|
import { defineCommand } from "citty";
|
|
@@ -53,7 +53,7 @@ async function runCompanyGet(client, flags, out) {
|
|
|
53
53
|
} catch (err) {
|
|
54
54
|
const { CurviateError } = await import("@curviate/sdk");
|
|
55
55
|
if (err instanceof CurviateError) {
|
|
56
|
-
const { getExitCode } = await import("./exit-codes-
|
|
56
|
+
const { getExitCode } = await import("./exit-codes-2ASIFXGR.js");
|
|
57
57
|
renderError(err, outOpts, out);
|
|
58
58
|
process.exit(getExitCode(err.code));
|
|
59
59
|
}
|
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
buildPreviewOutput
|
|
4
|
-
} from "./chunk-R3VLWLVV.js";
|
|
5
|
-
import {
|
|
6
|
-
resolveIdentifier
|
|
7
|
-
} from "./chunk-SZB3CFRZ.js";
|
|
8
2
|
import {
|
|
9
3
|
streamAll
|
|
10
4
|
} from "./chunk-GXTZION6.js";
|
|
5
|
+
import {
|
|
6
|
+
buildPreviewOutput
|
|
7
|
+
} from "./chunk-R3VLWLVV.js";
|
|
11
8
|
import {
|
|
12
9
|
slimInviteReceived,
|
|
13
10
|
slimInviteReceivedItem,
|
|
14
11
|
slimInviteSent,
|
|
15
12
|
slimInviteSentItem
|
|
16
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-SSPILTKF.js";
|
|
14
|
+
import {
|
|
15
|
+
resolveIdentifier
|
|
16
|
+
} from "./chunk-DMQZEPQE.js";
|
|
17
17
|
import {
|
|
18
18
|
createClient,
|
|
19
19
|
renderError,
|
|
20
20
|
renderSuccess,
|
|
21
21
|
renderUnexpectedError,
|
|
22
22
|
resolveEffectiveConfig
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-JXF47TRY.js";
|
|
24
24
|
import {
|
|
25
25
|
GLOBAL_FLAGS,
|
|
26
26
|
WRITE_FLAGS
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-4JHGVY7R.js";
|
|
28
28
|
|
|
29
29
|
// src/commands/connect.ts
|
|
30
30
|
import { defineCommand } from "citty";
|
|
@@ -79,7 +79,7 @@ async function runConnectSend(client, flags, out) {
|
|
|
79
79
|
} catch (err) {
|
|
80
80
|
const { CurviateError } = await import("@curviate/sdk");
|
|
81
81
|
if (err instanceof CurviateError) {
|
|
82
|
-
const { getExitCode } = await import("./exit-codes-
|
|
82
|
+
const { getExitCode } = await import("./exit-codes-2ASIFXGR.js");
|
|
83
83
|
renderError(err, outOpts, out);
|
|
84
84
|
process.exit(getExitCode(err.code));
|
|
85
85
|
}
|
|
@@ -117,7 +117,7 @@ async function runConnectSent(client, flags, out) {
|
|
|
117
117
|
} catch (err) {
|
|
118
118
|
const { CurviateError } = await import("@curviate/sdk");
|
|
119
119
|
if (err instanceof CurviateError) {
|
|
120
|
-
const { getExitCode } = await import("./exit-codes-
|
|
120
|
+
const { getExitCode } = await import("./exit-codes-2ASIFXGR.js");
|
|
121
121
|
renderError(err, outOpts, out);
|
|
122
122
|
process.exit(getExitCode(err.code));
|
|
123
123
|
}
|
|
@@ -155,7 +155,7 @@ async function runConnectReceived(client, flags, out) {
|
|
|
155
155
|
} catch (err) {
|
|
156
156
|
const { CurviateError } = await import("@curviate/sdk");
|
|
157
157
|
if (err instanceof CurviateError) {
|
|
158
|
-
const { getExitCode } = await import("./exit-codes-
|
|
158
|
+
const { getExitCode } = await import("./exit-codes-2ASIFXGR.js");
|
|
159
159
|
renderError(err, outOpts, out);
|
|
160
160
|
process.exit(getExitCode(err.code));
|
|
161
161
|
}
|
|
@@ -193,7 +193,7 @@ async function runConnectRespond(client, flags, out) {
|
|
|
193
193
|
} catch (err) {
|
|
194
194
|
const { CurviateError } = await import("@curviate/sdk");
|
|
195
195
|
if (err instanceof CurviateError) {
|
|
196
|
-
const { getExitCode } = await import("./exit-codes-
|
|
196
|
+
const { getExitCode } = await import("./exit-codes-2ASIFXGR.js");
|
|
197
197
|
renderError(err, outOpts, out);
|
|
198
198
|
process.exit(getExitCode(err.code));
|
|
199
199
|
}
|
|
@@ -222,7 +222,7 @@ async function runConnectCancel(client, flags, out) {
|
|
|
222
222
|
} catch (err) {
|
|
223
223
|
const { CurviateError } = await import("@curviate/sdk");
|
|
224
224
|
if (err instanceof CurviateError) {
|
|
225
|
-
const { getExitCode } = await import("./exit-codes-
|
|
225
|
+
const { getExitCode } = await import("./exit-codes-2ASIFXGR.js");
|
|
226
226
|
renderError(err, outOpts, out);
|
|
227
227
|
process.exit(getExitCode(err.code));
|
|
228
228
|
}
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
normalizeChatId
|
|
4
|
-
} from "./chunk-SZB3CFRZ.js";
|
|
5
2
|
import {
|
|
6
3
|
streamAll
|
|
7
4
|
} from "./chunk-GXTZION6.js";
|
|
5
|
+
import {
|
|
6
|
+
normalizeChatId
|
|
7
|
+
} from "./chunk-DMQZEPQE.js";
|
|
8
8
|
import {
|
|
9
9
|
createClient,
|
|
10
10
|
renderError,
|
|
11
11
|
renderSuccess,
|
|
12
12
|
renderUnexpectedError,
|
|
13
13
|
resolveEffectiveConfig
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-JXF47TRY.js";
|
|
15
15
|
import {
|
|
16
16
|
GLOBAL_FLAGS,
|
|
17
17
|
READ_SINGLE_FLAGS
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-4JHGVY7R.js";
|
|
19
19
|
|
|
20
20
|
// src/commands/inbox.ts
|
|
21
21
|
import { defineCommand } from "citty";
|
|
@@ -69,7 +69,7 @@ function validateIsoZTimestamp(value, flagName, out) {
|
|
|
69
69
|
async function handleSdkError(err, outOpts, out) {
|
|
70
70
|
const { CurviateError } = await import("@curviate/sdk");
|
|
71
71
|
if (err instanceof CurviateError) {
|
|
72
|
-
const { getExitCode } = await import("./exit-codes-
|
|
72
|
+
const { getExitCode } = await import("./exit-codes-2ASIFXGR.js");
|
|
73
73
|
renderError(err, outOpts, out);
|
|
74
74
|
process.exit(getExitCode(err.code));
|
|
75
75
|
}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
slimJob
|
|
4
|
+
} from "./chunk-SSPILTKF.js";
|
|
5
|
+
import {
|
|
6
|
+
resolveJobIdentifier
|
|
7
|
+
} from "./chunk-DMQZEPQE.js";
|
|
8
|
+
import {
|
|
9
|
+
createClient,
|
|
10
|
+
renderError,
|
|
11
|
+
renderSuccess,
|
|
12
|
+
renderUnexpectedError,
|
|
13
|
+
resolveEffectiveConfig
|
|
14
|
+
} from "./chunk-JXF47TRY.js";
|
|
15
|
+
import {
|
|
16
|
+
READ_SINGLE_FLAGS
|
|
17
|
+
} from "./chunk-4JHGVY7R.js";
|
|
18
|
+
|
|
19
|
+
// src/commands/job.ts
|
|
20
|
+
import { defineCommand } from "citty";
|
|
21
|
+
function buildOutputStreams() {
|
|
22
|
+
return {
|
|
23
|
+
stdout: { write: (s) => process.stdout.write(s) },
|
|
24
|
+
stderr: { write: (s) => process.stderr.write(s) }
|
|
25
|
+
};
|
|
26
|
+
}
|
|
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
|
+
function resolveOutputOpts(flags) {
|
|
35
|
+
return {
|
|
36
|
+
json: (flags.json ?? false) || !process.stdout.isTTY,
|
|
37
|
+
isTTY: process.stdout.isTTY ?? false,
|
|
38
|
+
fields: flags.fields,
|
|
39
|
+
verbose: flags.verbose ?? false
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
async function runJobGet(client, flags, out) {
|
|
43
|
+
if (flags.preview) {
|
|
44
|
+
out.stderr.write("error: --preview is only valid on write commands (mutations). Reads just run.\n");
|
|
45
|
+
process.exit(2);
|
|
46
|
+
}
|
|
47
|
+
const accountId = requireAccount(flags.account, out);
|
|
48
|
+
const rawId = flags.id ?? "";
|
|
49
|
+
const resolvedId = resolveJobIdentifier(rawId);
|
|
50
|
+
const ns = client.account(accountId);
|
|
51
|
+
const outOpts = resolveOutputOpts(flags);
|
|
52
|
+
try {
|
|
53
|
+
const result = await ns.jobs.get(resolvedId);
|
|
54
|
+
renderSuccess(result, { ...outOpts, slim: slimJob }, out);
|
|
55
|
+
} catch (err) {
|
|
56
|
+
const { CurviateError } = await import("@curviate/sdk");
|
|
57
|
+
if (err instanceof CurviateError) {
|
|
58
|
+
const { getExitCode } = await import("./exit-codes-2ASIFXGR.js");
|
|
59
|
+
renderError(err, outOpts, out);
|
|
60
|
+
process.exit(getExitCode(err.code));
|
|
61
|
+
}
|
|
62
|
+
renderUnexpectedError(err, out);
|
|
63
|
+
process.exit(1);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
var jobGetCommand = defineCommand({
|
|
67
|
+
meta: { name: "get", description: "Retrieve one public LinkedIn job posting's full detail." },
|
|
68
|
+
args: {
|
|
69
|
+
...READ_SINGLE_FLAGS,
|
|
70
|
+
id: { type: "positional", description: "Job URL (e.g. https://www.linkedin.com/jobs/view/4428113858) or a bare numeric job id." }
|
|
71
|
+
},
|
|
72
|
+
async run({ args }) {
|
|
73
|
+
const flags = args;
|
|
74
|
+
const cfg = await resolveEffectiveConfig({
|
|
75
|
+
apiKey: flags["api-key"],
|
|
76
|
+
baseUrl: flags["base-url"],
|
|
77
|
+
timeout: flags.timeout,
|
|
78
|
+
account: flags.account,
|
|
79
|
+
profile: flags.profile
|
|
80
|
+
});
|
|
81
|
+
if (!cfg.apiKey) {
|
|
82
|
+
process.stderr.write("error: no API key \u2014 run `curviate login` or pass --api-key.\n");
|
|
83
|
+
process.exit(3);
|
|
84
|
+
}
|
|
85
|
+
const client = createClient({ apiKey: cfg.apiKey, baseUrl: cfg.baseUrl, timeout: cfg.timeout });
|
|
86
|
+
const out = buildOutputStreams();
|
|
87
|
+
await runJobGet(client, { ...flags, account: flags.account ?? cfg.account }, out);
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
var jobCommand = defineCommand({
|
|
91
|
+
meta: { name: "job", description: "Public LinkedIn job posting operations." },
|
|
92
|
+
args: { ...READ_SINGLE_FLAGS },
|
|
93
|
+
subCommands: {
|
|
94
|
+
get: jobGetCommand
|
|
95
|
+
},
|
|
96
|
+
async run() {
|
|
97
|
+
process.stderr.write(
|
|
98
|
+
"Usage: curviate job get <url|id>\n"
|
|
99
|
+
);
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
export {
|
|
103
|
+
jobCommand,
|
|
104
|
+
runJobGet
|
|
105
|
+
};
|
|
@@ -1,59 +1,14 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
readlineSync
|
|
4
|
+
} from "./chunk-MKXA2LAR.js";
|
|
2
5
|
import {
|
|
3
6
|
GLOBAL_FLAGS,
|
|
4
7
|
writeProfile
|
|
5
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-4JHGVY7R.js";
|
|
6
9
|
|
|
7
10
|
// src/commands/login.ts
|
|
8
11
|
import { defineCommand } from "citty";
|
|
9
|
-
|
|
10
|
-
// src/lib/readline.ts
|
|
11
|
-
import { createInterface } from "readline";
|
|
12
|
-
async function readlineSync(prompt, opts = {}) {
|
|
13
|
-
return new Promise((resolve, reject) => {
|
|
14
|
-
process.stderr.write(prompt);
|
|
15
|
-
if (opts.mask && typeof process.stdin.setRawMode === "function") {
|
|
16
|
-
process.stdin.setRawMode(true);
|
|
17
|
-
process.stdin.resume();
|
|
18
|
-
process.stdin.setEncoding("utf8");
|
|
19
|
-
let input = "";
|
|
20
|
-
const onData = (char) => {
|
|
21
|
-
if (char === "\r" || char === "\n") {
|
|
22
|
-
process.stdin.setRawMode(false);
|
|
23
|
-
process.stdin.pause();
|
|
24
|
-
process.stdin.removeListener("data", onData);
|
|
25
|
-
process.stderr.write("\n");
|
|
26
|
-
resolve(input);
|
|
27
|
-
} else if (char === "") {
|
|
28
|
-
process.stdin.setRawMode(false);
|
|
29
|
-
process.stdin.pause();
|
|
30
|
-
process.stdin.removeListener("data", onData);
|
|
31
|
-
reject(new Error("Interrupted."));
|
|
32
|
-
} else if (char === "\x7F" || char === "\b") {
|
|
33
|
-
input = input.slice(0, -1);
|
|
34
|
-
} else {
|
|
35
|
-
input += char;
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
process.stdin.on("data", onData);
|
|
39
|
-
} else {
|
|
40
|
-
const rl = createInterface({
|
|
41
|
-
input: process.stdin,
|
|
42
|
-
output: void 0,
|
|
43
|
-
// suppress default echo (prompt already on stderr)
|
|
44
|
-
terminal: false
|
|
45
|
-
});
|
|
46
|
-
rl.once("line", (line) => {
|
|
47
|
-
rl.close();
|
|
48
|
-
resolve(line.trim());
|
|
49
|
-
});
|
|
50
|
-
rl.once("error", reject);
|
|
51
|
-
rl.once("close", () => resolve(""));
|
|
52
|
-
}
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
// src/commands/login.ts
|
|
57
12
|
async function runLogin(args, out) {
|
|
58
13
|
const profileName = args.profile ?? "default";
|
|
59
14
|
const apiKey = (args["api-key"] ?? "").trim();
|
|
@@ -9,25 +9,25 @@ import {
|
|
|
9
9
|
} from "./chunk-Q43HZUN3.js";
|
|
10
10
|
import {
|
|
11
11
|
resolveTextOrStdin
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-U7Y4EXHT.js";
|
|
13
13
|
import {
|
|
14
14
|
buildPreviewOutput
|
|
15
15
|
} from "./chunk-R3VLWLVV.js";
|
|
16
16
|
import {
|
|
17
17
|
normalizeChatId,
|
|
18
18
|
resolveIdentifier
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-DMQZEPQE.js";
|
|
20
20
|
import {
|
|
21
21
|
createClient,
|
|
22
22
|
renderError,
|
|
23
23
|
renderSuccess,
|
|
24
24
|
renderUnexpectedError,
|
|
25
25
|
resolveEffectiveConfig
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-JXF47TRY.js";
|
|
27
27
|
import {
|
|
28
28
|
READ_SINGLE_FLAGS,
|
|
29
29
|
WRITE_FLAGS
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-4JHGVY7R.js";
|
|
31
31
|
|
|
32
32
|
// src/commands/message.ts
|
|
33
33
|
import { defineCommand } from "citty";
|
|
@@ -73,7 +73,7 @@ var MEMBER_PROVIDER_ID_RE = /^A[CDE][A-Za-z0-9_-]{4,}$/;
|
|
|
73
73
|
async function handleSdkError(err, outOpts, out) {
|
|
74
74
|
const { CurviateError } = await import("@curviate/sdk");
|
|
75
75
|
if (err instanceof CurviateError) {
|
|
76
|
-
const { getExitCode } = await import("./exit-codes-
|
|
76
|
+
const { getExitCode } = await import("./exit-codes-2ASIFXGR.js");
|
|
77
77
|
renderError(err, outOpts, out);
|
|
78
78
|
process.exit(getExitCode(err.code));
|
|
79
79
|
}
|
|
@@ -5,24 +5,24 @@ import {
|
|
|
5
5
|
} from "./chunk-Q43HZUN3.js";
|
|
6
6
|
import {
|
|
7
7
|
resolveTextOrStdin
|
|
8
|
-
} from "./chunk-
|
|
9
|
-
import {
|
|
10
|
-
buildPreviewOutput
|
|
11
|
-
} from "./chunk-R3VLWLVV.js";
|
|
8
|
+
} from "./chunk-U7Y4EXHT.js";
|
|
12
9
|
import {
|
|
13
10
|
streamAll
|
|
14
11
|
} from "./chunk-GXTZION6.js";
|
|
12
|
+
import {
|
|
13
|
+
buildPreviewOutput
|
|
14
|
+
} from "./chunk-R3VLWLVV.js";
|
|
15
15
|
import {
|
|
16
16
|
createClient,
|
|
17
17
|
renderError,
|
|
18
18
|
renderSuccess,
|
|
19
19
|
renderUnexpectedError,
|
|
20
20
|
resolveEffectiveConfig
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-JXF47TRY.js";
|
|
22
22
|
import {
|
|
23
23
|
GLOBAL_FLAGS,
|
|
24
24
|
WRITE_FLAGS
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-4JHGVY7R.js";
|
|
26
26
|
|
|
27
27
|
// src/commands/post.ts
|
|
28
28
|
import { defineCommand } from "citty";
|
|
@@ -72,7 +72,7 @@ function normalizeAttachPaths(attach) {
|
|
|
72
72
|
async function handleSdkError(err, outOpts, out) {
|
|
73
73
|
const { CurviateError } = await import("@curviate/sdk");
|
|
74
74
|
if (err instanceof CurviateError) {
|
|
75
|
-
const { getExitCode } = await import("./exit-codes-
|
|
75
|
+
const { getExitCode } = await import("./exit-codes-2ASIFXGR.js");
|
|
76
76
|
renderError(err, outOpts, out);
|
|
77
77
|
process.exit(getExitCode(err.code));
|
|
78
78
|
}
|