@curviate/cli 0.2.0 → 0.4.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 +31 -0
- package/dist/{account-YOW2MCZS.js → account-3I63RFVN.js} +2 -2
- package/dist/chunk-5NS2G4WQ.js +95 -0
- package/dist/{chunk-6JNCLLNY.js → chunk-QQRTODHN.js} +5 -0
- package/dist/{chunk-2NCPJJPC.js → chunk-UPNQPAJG.js} +3 -2
- package/dist/cli.js +13 -13
- package/dist/{company-IKVDW7MX.js → company-FHNHF2WQ.js} +14 -4
- package/dist/{config-4JOXBFYX.js → config-E2XQNLSX.js} +1 -1
- package/dist/{connect-XPXYKOII.js → connect-LRYVZCN6.js} +2 -2
- package/dist/{inbox-JBLYJMV2.js → inbox-O4ZETUIU.js} +2 -2
- package/dist/{login-VWJEBBFU.js → login-PUTCMS5B.js} +38 -12
- package/dist/{message-SFP2I7QE.js → message-A3XMZCQA.js} +2 -2
- package/dist/{post-EAAGVR5D.js → post-HOXZPFVI.js} +2 -2
- package/dist/{profile-WXA3NC7D.js → profile-KVTWLH7X.js} +53 -11
- package/dist/{recruiter-D4BO4NO4.js → recruiter-7SE3YCVZ.js} +2 -2
- package/dist/{sales-nav-F5VK7CPD.js → sales-nav-E3TH7CL7.js} +2 -2
- package/dist/{search-XJMVHZIZ.js → search-ZPGKDJIT.js} +2 -2
- package/dist/{webhook-QM5LGAUF.js → webhook-VSM72KL5.js} +2 -2
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -8,6 +8,37 @@ 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.4.0] - 2026-06-28
|
|
12
|
+
|
|
13
|
+
### Added
|
|
14
|
+
|
|
15
|
+
- `profile me` slim now includes `current_position` (synthesized from `work_experience[0]`
|
|
16
|
+
when `--sections experience` is passed), achieving parity with `profile <id>` slim.
|
|
17
|
+
|
|
18
|
+
### Fixed
|
|
19
|
+
|
|
20
|
+
- `repository.url` in `package.json` normalized to the npm-canonical `git+https://` prefix.
|
|
21
|
+
|
|
22
|
+
## [0.3.0] - 2026-06-28
|
|
23
|
+
|
|
24
|
+
### Added
|
|
25
|
+
|
|
26
|
+
- `profile me` and `profile get` now return a slim 9-field projection by default (`id`, `first_name`, `last_name`, `headline`, `location`, `industry`, `profile_url`, `picture_url`, `current_position`); pass `--verbose` to get the full response.
|
|
27
|
+
- `profile get` synthesizes `current_position` from `work_experience[0]` when present.
|
|
28
|
+
- `profile get` and `profile me` accept `--sections` to request specific LinkedIn profile sections from the API.
|
|
29
|
+
- `profile get --posts --is-company` resolves a company slug to an account ID automatically (non-numeric IDs call `getCompany` first).
|
|
30
|
+
- `company get` now returns a slim 12-field projection by default (including `headquarters` and `messaging`); pass `--verbose` to get the full response.
|
|
31
|
+
- `login` persists `--base-url` to the named profile; re-login without `--base-url` preserves the existing base URL.
|
|
32
|
+
|
|
33
|
+
### Fixed
|
|
34
|
+
|
|
35
|
+
- `company` command now exits 2 with an error when `--sections` is passed (unsupported flag for that surface).
|
|
36
|
+
- `slimProfile` work_experience field mapping corrected (`position`→`title`, `company`→`company_name`); `is_current` now derived from `end == null`; `company_id` is always `null` (the experience-entry ID is not a company ID).
|
|
37
|
+
|
|
38
|
+
### Changed
|
|
39
|
+
|
|
40
|
+
- Updated `@curviate/sdk` dependency to `^0.2.0` (adds `getMe` `linkedin_sections`, normalized `OwnProfile`, `Chat.subject`).
|
|
41
|
+
|
|
11
42
|
## [0.2.0] - 2026-06-24
|
|
12
43
|
|
|
13
44
|
### Fixed
|
|
@@ -11,10 +11,10 @@ import {
|
|
|
11
11
|
renderSuccess,
|
|
12
12
|
renderUnexpectedError,
|
|
13
13
|
resolveEffectiveConfig
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-UPNQPAJG.js";
|
|
15
15
|
import {
|
|
16
16
|
GLOBAL_FLAGS
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-QQRTODHN.js";
|
|
18
18
|
|
|
19
19
|
// src/commands/account.ts
|
|
20
20
|
import { defineCommand } from "citty";
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
// src/lib/slim.ts
|
|
4
|
+
function synthesizeCurrentPosition(workExperience) {
|
|
5
|
+
if (!Array.isArray(workExperience) || workExperience.length === 0) {
|
|
6
|
+
return null;
|
|
7
|
+
}
|
|
8
|
+
const entry = workExperience[0];
|
|
9
|
+
return {
|
|
10
|
+
title: entry["position"] ?? null,
|
|
11
|
+
company_name: entry["company"] ?? null,
|
|
12
|
+
company_id: null,
|
|
13
|
+
is_current: entry["end"] == null
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
function synthesizeHeadquarters(locations) {
|
|
17
|
+
if (!Array.isArray(locations)) return null;
|
|
18
|
+
const hq = locations.find(
|
|
19
|
+
(l) => l["is_headquarter"] === true
|
|
20
|
+
);
|
|
21
|
+
if (!hq) return null;
|
|
22
|
+
return {
|
|
23
|
+
city: hq["city"] ?? null,
|
|
24
|
+
country: hq["country"] ?? null,
|
|
25
|
+
area: hq["area"] ?? null
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
function slimProfileMe(data) {
|
|
29
|
+
const d = data !== null && data !== void 0 && typeof data === "object" ? data : {};
|
|
30
|
+
const rawOrgs = Array.isArray(d["organizations"]) ? d["organizations"] : [];
|
|
31
|
+
const organizations = rawOrgs.map((org) => ({
|
|
32
|
+
id: org["id"] ?? null,
|
|
33
|
+
mailbox_id: org["mailbox_id"] ?? null,
|
|
34
|
+
name: org["name"] ?? null
|
|
35
|
+
}));
|
|
36
|
+
const rawWE = Array.isArray(d["work_experience"]) ? d["work_experience"] : [];
|
|
37
|
+
const currentPosition = synthesizeCurrentPosition(rawWE);
|
|
38
|
+
return {
|
|
39
|
+
provider_id: d["provider_id"] ?? null,
|
|
40
|
+
first_name: d["first_name"] ?? null,
|
|
41
|
+
last_name: d["last_name"] ?? null,
|
|
42
|
+
public_identifier: d["public_identifier"] ?? null,
|
|
43
|
+
location: d["location"] ?? null,
|
|
44
|
+
email: d["email"] ?? null,
|
|
45
|
+
occupation: d["occupation"] ?? null,
|
|
46
|
+
is_premium: d["is_premium"] ?? null,
|
|
47
|
+
organizations,
|
|
48
|
+
current_position: currentPosition
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
function slimProfile(data) {
|
|
52
|
+
const d = data !== null && data !== void 0 && typeof data === "object" ? data : {};
|
|
53
|
+
const rawWE = Array.isArray(d["work_experience"]) ? d["work_experience"] : [];
|
|
54
|
+
const currentPosition = synthesizeCurrentPosition(rawWE);
|
|
55
|
+
return {
|
|
56
|
+
provider_id: d["provider_id"] ?? null,
|
|
57
|
+
first_name: d["first_name"] ?? null,
|
|
58
|
+
last_name: d["last_name"] ?? null,
|
|
59
|
+
headline: d["headline"] ?? null,
|
|
60
|
+
location: d["location"] ?? null,
|
|
61
|
+
occupation: d["occupation"] ?? null,
|
|
62
|
+
network_distance: d["network_distance"] ?? null,
|
|
63
|
+
public_identifier: d["public_identifier"] ?? null,
|
|
64
|
+
current_position: currentPosition
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
function slimCompany(data) {
|
|
68
|
+
const d = data !== null && data !== void 0 && typeof data === "object" ? data : {};
|
|
69
|
+
const rawMessaging = d["messaging"] !== null && d["messaging"] !== void 0 && typeof d["messaging"] === "object" ? d["messaging"] : null;
|
|
70
|
+
const messaging = {
|
|
71
|
+
is_enabled: rawMessaging?.["is_enabled"] ?? false
|
|
72
|
+
};
|
|
73
|
+
const rawLocations = Array.isArray(d["locations"]) ? d["locations"] : [];
|
|
74
|
+
const headquarters = synthesizeHeadquarters(rawLocations);
|
|
75
|
+
return {
|
|
76
|
+
id: d["id"] ?? null,
|
|
77
|
+
name: d["name"] ?? null,
|
|
78
|
+
public_identifier: d["public_identifier"] ?? null,
|
|
79
|
+
profile_url: d["profile_url"] ?? null,
|
|
80
|
+
industry: d["industry"] ?? null,
|
|
81
|
+
employee_count: d["employee_count"] ?? null,
|
|
82
|
+
employee_count_range: d["employee_count_range"] ?? null,
|
|
83
|
+
website: d["website"] ?? null,
|
|
84
|
+
foundation_date: d["foundation_date"] ?? null,
|
|
85
|
+
messaging,
|
|
86
|
+
headquarters,
|
|
87
|
+
followers_count: d["followers_count"] ?? null
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export {
|
|
92
|
+
slimProfileMe,
|
|
93
|
+
slimProfile,
|
|
94
|
+
slimCompany
|
|
95
|
+
};
|
|
@@ -180,6 +180,11 @@ var GLOBAL_FLAGS = {
|
|
|
180
180
|
type: "boolean",
|
|
181
181
|
description: "Render the request that would be sent without calling the API.",
|
|
182
182
|
default: false
|
|
183
|
+
},
|
|
184
|
+
verbose: {
|
|
185
|
+
type: "boolean",
|
|
186
|
+
description: "Output the full SDK response instead of the slim default.",
|
|
187
|
+
default: false
|
|
183
188
|
}
|
|
184
189
|
};
|
|
185
190
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
readConfig
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-QQRTODHN.js";
|
|
5
5
|
|
|
6
6
|
// src/lib/resolve.ts
|
|
7
7
|
var DEFAULT_BASE_URL = "https://api.curviate.com";
|
|
@@ -76,7 +76,8 @@ function applyProjection(data, fields) {
|
|
|
76
76
|
function renderSuccess(data, opts, out) {
|
|
77
77
|
const json = isJsonMode(opts);
|
|
78
78
|
const fields = opts.fields ? opts.fields.split(",").map((f) => f.trim()).filter(Boolean) : [];
|
|
79
|
-
const
|
|
79
|
+
const slimmed = !opts.verbose && opts.slim ? opts.slim(data) : data;
|
|
80
|
+
const projected = applyProjection(slimmed, fields);
|
|
80
81
|
if (json) {
|
|
81
82
|
out.stdout.write(JSON.stringify(projected) + "\n");
|
|
82
83
|
} else {
|
package/dist/cli.js
CHANGED
|
@@ -134,22 +134,22 @@ var main = defineCommand({
|
|
|
134
134
|
// Subcommand registry — names and descriptions are static for help rendering;
|
|
135
135
|
// the handler implementation is loaded lazily on first invocation.
|
|
136
136
|
subCommands: {
|
|
137
|
-
login: () => import("./login-
|
|
138
|
-
config: () => import("./config-
|
|
137
|
+
login: () => import("./login-PUTCMS5B.js").then((m) => m.loginCommand),
|
|
138
|
+
config: () => import("./config-E2XQNLSX.js").then((m) => m.configCommand),
|
|
139
139
|
// ---------------------------------------------------------------------------
|
|
140
140
|
// Noun groups — lazy-loaded on first invocation.
|
|
141
141
|
// ---------------------------------------------------------------------------
|
|
142
|
-
profile: () => import("./profile-
|
|
143
|
-
company: () => import("./company-
|
|
144
|
-
connect: () => import("./connect-
|
|
145
|
-
search: () => import("./search-
|
|
146
|
-
inbox: () => import("./inbox-
|
|
147
|
-
message: () => import("./message-
|
|
148
|
-
post: () => import("./post-
|
|
149
|
-
account: () => import("./account-
|
|
150
|
-
webhook: () => import("./webhook-
|
|
151
|
-
"sales-nav": () => import("./sales-nav-
|
|
152
|
-
recruiter: () => import("./recruiter-
|
|
142
|
+
profile: () => import("./profile-KVTWLH7X.js").then((m) => m.profileCommand),
|
|
143
|
+
company: () => import("./company-FHNHF2WQ.js").then((m) => m.companyCommand),
|
|
144
|
+
connect: () => import("./connect-LRYVZCN6.js").then((m) => m.connectCommand),
|
|
145
|
+
search: () => import("./search-ZPGKDJIT.js").then((m) => m.searchCommand),
|
|
146
|
+
inbox: () => import("./inbox-O4ZETUIU.js").then((m) => m.inboxCommand),
|
|
147
|
+
message: () => import("./message-A3XMZCQA.js").then((m) => m.messageCommand),
|
|
148
|
+
post: () => import("./post-HOXZPFVI.js").then((m) => m.postCommand),
|
|
149
|
+
account: () => import("./account-3I63RFVN.js").then((m) => m.accountCommand),
|
|
150
|
+
webhook: () => import("./webhook-VSM72KL5.js").then((m) => m.webhookCommand),
|
|
151
|
+
"sales-nav": () => import("./sales-nav-E3TH7CL7.js").then((m) => m.salesNavCommand),
|
|
152
|
+
recruiter: () => import("./recruiter-7SE3YCVZ.js").then((m) => m.recruiterCommand)
|
|
153
153
|
},
|
|
154
154
|
async run() {
|
|
155
155
|
const { runMain } = await import("citty");
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
slimCompany
|
|
4
|
+
} from "./chunk-5NS2G4WQ.js";
|
|
2
5
|
import {
|
|
3
6
|
resolveIdentifier
|
|
4
7
|
} from "./chunk-BNUTM6KD.js";
|
|
@@ -8,10 +11,10 @@ import {
|
|
|
8
11
|
renderSuccess,
|
|
9
12
|
renderUnexpectedError,
|
|
10
13
|
resolveEffectiveConfig
|
|
11
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-UPNQPAJG.js";
|
|
12
15
|
import {
|
|
13
16
|
GLOBAL_FLAGS
|
|
14
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-QQRTODHN.js";
|
|
15
18
|
|
|
16
19
|
// src/commands/company.ts
|
|
17
20
|
import { defineCommand } from "citty";
|
|
@@ -30,12 +33,18 @@ async function runCompanyGet(client, flags, out) {
|
|
|
30
33
|
out.stderr.write("error: --all is not supported on non-paginated commands.\n");
|
|
31
34
|
process.exit(2);
|
|
32
35
|
}
|
|
36
|
+
if (flags.sections !== void 0) {
|
|
37
|
+
out.stderr.write("error: --sections is not supported on company commands.\n");
|
|
38
|
+
process.exit(2);
|
|
39
|
+
}
|
|
33
40
|
const rawId = flags.id ?? "";
|
|
34
41
|
const resolvedId = resolveIdentifier(rawId);
|
|
35
42
|
const outOpts = {
|
|
36
43
|
json: (flags.json ?? false) || !process.stdout.isTTY,
|
|
37
44
|
isTTY: process.stdout.isTTY ?? false,
|
|
38
|
-
fields: flags.fields
|
|
45
|
+
fields: flags.fields,
|
|
46
|
+
verbose: flags.verbose ?? false,
|
|
47
|
+
slim: slimCompany
|
|
39
48
|
};
|
|
40
49
|
try {
|
|
41
50
|
const getCompany = flags.account ? client.account(flags.account).profiles.getCompany.bind(client.account(flags.account).profiles) : client.profiles.getCompany.bind(client.profiles);
|
|
@@ -56,7 +65,8 @@ var companyCommand = defineCommand({
|
|
|
56
65
|
meta: { name: "company", description: "Fetch a company profile by URL or slug." },
|
|
57
66
|
args: {
|
|
58
67
|
...GLOBAL_FLAGS,
|
|
59
|
-
id: { type: "positional", description: "Company identifier (URL, slug, or native id)." }
|
|
68
|
+
id: { type: "positional", description: "Company identifier (URL, slug, or native id)." },
|
|
69
|
+
sections: { type: "string", description: "Not supported on company commands \u2014 usage error (exit 2) if supplied." }
|
|
60
70
|
},
|
|
61
71
|
async run({ args }) {
|
|
62
72
|
const flags = args;
|
|
@@ -14,10 +14,10 @@ import {
|
|
|
14
14
|
renderSuccess,
|
|
15
15
|
renderUnexpectedError,
|
|
16
16
|
resolveEffectiveConfig
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-UPNQPAJG.js";
|
|
18
18
|
import {
|
|
19
19
|
GLOBAL_FLAGS
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-QQRTODHN.js";
|
|
21
21
|
|
|
22
22
|
// src/commands/connect.ts
|
|
23
23
|
import { defineCommand } from "citty";
|
|
@@ -8,10 +8,10 @@ import {
|
|
|
8
8
|
renderSuccess,
|
|
9
9
|
renderUnexpectedError,
|
|
10
10
|
resolveEffectiveConfig
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-UPNQPAJG.js";
|
|
12
12
|
import {
|
|
13
13
|
GLOBAL_FLAGS
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-QQRTODHN.js";
|
|
15
15
|
|
|
16
16
|
// src/commands/inbox.ts
|
|
17
17
|
import { defineCommand } from "citty";
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
GLOBAL_FLAGS,
|
|
4
4
|
writeProfile
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-QQRTODHN.js";
|
|
6
6
|
|
|
7
7
|
// src/commands/login.ts
|
|
8
8
|
import { defineCommand } from "citty";
|
|
@@ -54,6 +54,31 @@ async function readlineSync(prompt, opts = {}) {
|
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
// src/commands/login.ts
|
|
57
|
+
async function runLogin(args, out) {
|
|
58
|
+
const profileName = args.profile ?? "default";
|
|
59
|
+
const apiKey = (args["api-key"] ?? "").trim();
|
|
60
|
+
if (!apiKey) {
|
|
61
|
+
out.stderr.write("error: API key must not be empty.\n");
|
|
62
|
+
process.exit(2);
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
const baseUrl = args["base-url"];
|
|
66
|
+
if (baseUrl === "") {
|
|
67
|
+
out.stderr.write("error: --base-url must not be empty.\n");
|
|
68
|
+
process.exit(2);
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
const account = args.account;
|
|
72
|
+
const entry = { apiKey, account };
|
|
73
|
+
if (baseUrl !== void 0 && baseUrl !== "") {
|
|
74
|
+
entry.baseUrl = baseUrl;
|
|
75
|
+
}
|
|
76
|
+
await writeProfile(profileName, entry);
|
|
77
|
+
out.stderr.write(
|
|
78
|
+
`Saved to profile "${profileName}". Run \`curviate profile me\` to verify.
|
|
79
|
+
`
|
|
80
|
+
);
|
|
81
|
+
}
|
|
57
82
|
var loginCommand = defineCommand({
|
|
58
83
|
meta: {
|
|
59
84
|
name: "login",
|
|
@@ -89,18 +114,18 @@ var loginCommand = defineCommand({
|
|
|
89
114
|
"error: no API key \u2014 pass --api-key or run interactively on a TTY.\n"
|
|
90
115
|
);
|
|
91
116
|
process.exit(2);
|
|
117
|
+
return;
|
|
92
118
|
}
|
|
93
119
|
}
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
`
|
|
120
|
+
const out = { stderr: { write: (s) => process.stderr.write(s) } };
|
|
121
|
+
await runLogin(
|
|
122
|
+
{
|
|
123
|
+
"api-key": apiKey,
|
|
124
|
+
account: args.account,
|
|
125
|
+
"base-url": args["base-url"],
|
|
126
|
+
profile: profileName
|
|
127
|
+
},
|
|
128
|
+
out
|
|
104
129
|
);
|
|
105
130
|
}
|
|
106
131
|
});
|
|
@@ -118,5 +143,6 @@ async function promptMasked(prompt) {
|
|
|
118
143
|
return readlineSync(prompt, { mask: true });
|
|
119
144
|
}
|
|
120
145
|
export {
|
|
121
|
-
loginCommand
|
|
146
|
+
loginCommand,
|
|
147
|
+
runLogin
|
|
122
148
|
};
|
|
@@ -19,10 +19,10 @@ import {
|
|
|
19
19
|
renderSuccess,
|
|
20
20
|
renderUnexpectedError,
|
|
21
21
|
resolveEffectiveConfig
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-UPNQPAJG.js";
|
|
23
23
|
import {
|
|
24
24
|
GLOBAL_FLAGS
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-QQRTODHN.js";
|
|
26
26
|
|
|
27
27
|
// src/commands/message.ts
|
|
28
28
|
import { defineCommand } from "citty";
|
|
@@ -15,10 +15,10 @@ import {
|
|
|
15
15
|
renderSuccess,
|
|
16
16
|
renderUnexpectedError,
|
|
17
17
|
resolveEffectiveConfig
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-UPNQPAJG.js";
|
|
19
19
|
import {
|
|
20
20
|
GLOBAL_FLAGS
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-QQRTODHN.js";
|
|
22
22
|
|
|
23
23
|
// src/commands/post.ts
|
|
24
24
|
import { defineCommand } from "citty";
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
slimProfile,
|
|
4
|
+
slimProfileMe
|
|
5
|
+
} from "./chunk-5NS2G4WQ.js";
|
|
2
6
|
import {
|
|
3
7
|
buildPreviewOutput
|
|
4
8
|
} from "./chunk-R3VLWLVV.js";
|
|
@@ -14,10 +18,10 @@ import {
|
|
|
14
18
|
renderSuccess,
|
|
15
19
|
renderUnexpectedError,
|
|
16
20
|
resolveEffectiveConfig
|
|
17
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-UPNQPAJG.js";
|
|
18
22
|
import {
|
|
19
23
|
GLOBAL_FLAGS
|
|
20
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-QQRTODHN.js";
|
|
21
25
|
|
|
22
26
|
// src/commands/profile.ts
|
|
23
27
|
import { defineCommand } from "citty";
|
|
@@ -50,18 +54,28 @@ function resolveOutputOpts(flags) {
|
|
|
50
54
|
return {
|
|
51
55
|
json: (flags.json ?? false) || !process.stdout.isTTY,
|
|
52
56
|
isTTY: process.stdout.isTTY ?? false,
|
|
53
|
-
fields: flags.fields
|
|
57
|
+
fields: flags.fields,
|
|
58
|
+
verbose: flags.verbose ?? false
|
|
54
59
|
};
|
|
55
60
|
}
|
|
56
61
|
async function runProfileMe(client, flags, out) {
|
|
57
62
|
rejectPreviewOnRead(flags.preview, out);
|
|
58
63
|
rejectAllOnNonPaginated(flags.all, out);
|
|
64
|
+
if (flags.sections === "") {
|
|
65
|
+
out.stderr.write("error: --sections must not be empty. Omit the flag or provide section names.\n");
|
|
66
|
+
process.exit(2);
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
59
69
|
const accountId = requireAccount(flags.account, out);
|
|
60
70
|
const ns = client.account(accountId);
|
|
71
|
+
const params = {};
|
|
72
|
+
if (flags.sections) {
|
|
73
|
+
params["linkedin_sections"] = flags.sections.split(",").map((s) => s.trim()).filter(Boolean);
|
|
74
|
+
}
|
|
61
75
|
try {
|
|
62
|
-
const result = await ns.profiles.getMe();
|
|
63
|
-
const
|
|
64
|
-
renderSuccess(result,
|
|
76
|
+
const result = await ns.profiles.getMe(params);
|
|
77
|
+
const outOpts = { ...resolveOutputOpts(flags), slim: slimProfileMe };
|
|
78
|
+
renderSuccess(result, outOpts, out);
|
|
65
79
|
} catch (err) {
|
|
66
80
|
const { CurviateError } = await import("@curviate/sdk");
|
|
67
81
|
if (err instanceof CurviateError) {
|
|
@@ -75,6 +89,12 @@ async function runProfileMe(client, flags, out) {
|
|
|
75
89
|
}
|
|
76
90
|
async function runProfileGet(client, flags, out) {
|
|
77
91
|
rejectPreviewOnRead(flags.preview, out);
|
|
92
|
+
const isListCommand = flags.posts || flags.comments || flags.reactions || flags.followers;
|
|
93
|
+
if (!isListCommand && flags.sections === "") {
|
|
94
|
+
out.stderr.write("error: --sections must not be empty. Omit the flag or provide section names.\n");
|
|
95
|
+
process.exit(2);
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
78
98
|
const accountId = requireAccount(flags.account, out);
|
|
79
99
|
const rawId = flags.id ?? "";
|
|
80
100
|
const resolvedId = resolveIdentifier(rawId);
|
|
@@ -90,8 +110,16 @@ async function runProfileGet(client, flags, out) {
|
|
|
90
110
|
if (flags["is-company"]) params["is_company"] = true;
|
|
91
111
|
if (limit !== void 0) params["limit"] = limit;
|
|
92
112
|
if (cursor) params["cursor"] = cursor;
|
|
113
|
+
let postId = resolvedId;
|
|
114
|
+
if (flags["is-company"]) {
|
|
115
|
+
const isNumericId = /^\d+$/.test(resolvedId);
|
|
116
|
+
if (!isNumericId) {
|
|
117
|
+
const companyData = await ns.profiles.getCompany(resolvedId);
|
|
118
|
+
postId = companyData["id"];
|
|
119
|
+
}
|
|
120
|
+
}
|
|
93
121
|
if (all) {
|
|
94
|
-
const fn = (p) => ns.profiles.listPosts(
|
|
122
|
+
const fn = (p) => ns.profiles.listPosts(postId, p);
|
|
95
123
|
for await (const item of streamAll(fn, params, {
|
|
96
124
|
maxPages,
|
|
97
125
|
onTruncated: (msg) => out.stderr.write(msg + "\n")
|
|
@@ -99,7 +127,7 @@ async function runProfileGet(client, flags, out) {
|
|
|
99
127
|
out.stdout.write(JSON.stringify(item) + "\n");
|
|
100
128
|
}
|
|
101
129
|
} else {
|
|
102
|
-
const result = await ns.profiles.listPosts(
|
|
130
|
+
const result = await ns.profiles.listPosts(postId, params);
|
|
103
131
|
renderSuccess(result, outOpts, out);
|
|
104
132
|
}
|
|
105
133
|
} else if (flags.comments) {
|
|
@@ -154,8 +182,12 @@ async function runProfileGet(client, flags, out) {
|
|
|
154
182
|
rejectAllOnNonPaginated(flags.all, out);
|
|
155
183
|
const params = {};
|
|
156
184
|
if (flags.notify) params["notify"] = true;
|
|
185
|
+
if (flags.sections) {
|
|
186
|
+
params["linkedin_sections"] = flags.sections.split(",").map((s) => s.trim()).filter(Boolean);
|
|
187
|
+
}
|
|
157
188
|
const result = await ns.profiles.get(resolvedId, params);
|
|
158
|
-
|
|
189
|
+
const getOutOpts = { ...outOpts, slim: slimProfile };
|
|
190
|
+
renderSuccess(result, getOutOpts, out);
|
|
159
191
|
}
|
|
160
192
|
} catch (err) {
|
|
161
193
|
const { CurviateError } = await import("@curviate/sdk");
|
|
@@ -237,7 +269,13 @@ async function runProfileEndorse(client, flags, out) {
|
|
|
237
269
|
}
|
|
238
270
|
var profileMeCommand = defineCommand({
|
|
239
271
|
meta: { name: "me", description: "Get your own LinkedIn profile." },
|
|
240
|
-
args: {
|
|
272
|
+
args: {
|
|
273
|
+
...GLOBAL_FLAGS,
|
|
274
|
+
sections: {
|
|
275
|
+
type: "string",
|
|
276
|
+
description: "Comma-separated LinkedIn sections to fetch (e.g. experience,education)."
|
|
277
|
+
}
|
|
278
|
+
},
|
|
241
279
|
async run({ args }) {
|
|
242
280
|
const flags = args;
|
|
243
281
|
const cfg = await resolveEffectiveConfig({
|
|
@@ -312,7 +350,11 @@ var profileCommand = defineCommand({
|
|
|
312
350
|
reactions: { type: "boolean", description: "List the profile's reactions.", default: false },
|
|
313
351
|
followers: { type: "boolean", description: "List the profile's followers.", default: false },
|
|
314
352
|
"is-company": { type: "boolean", description: "When listing posts, treat the profile as a company page.", default: false },
|
|
315
|
-
notify: { type: "boolean", description: "Signal a profile view when fetching.", default: false }
|
|
353
|
+
notify: { type: "boolean", description: "Signal a profile view when fetching.", default: false },
|
|
354
|
+
sections: {
|
|
355
|
+
type: "string",
|
|
356
|
+
description: "Comma-separated LinkedIn sections to fetch (e.g. experience,education)."
|
|
357
|
+
}
|
|
316
358
|
},
|
|
317
359
|
subCommands: {
|
|
318
360
|
me: profileMeCommand,
|
|
@@ -27,10 +27,10 @@ import {
|
|
|
27
27
|
renderSuccess,
|
|
28
28
|
renderUnexpectedError,
|
|
29
29
|
resolveEffectiveConfig
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-UPNQPAJG.js";
|
|
31
31
|
import {
|
|
32
32
|
GLOBAL_FLAGS
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-QQRTODHN.js";
|
|
34
34
|
|
|
35
35
|
// src/commands/recruiter.ts
|
|
36
36
|
import { defineCommand } from "citty";
|
|
@@ -24,10 +24,10 @@ import {
|
|
|
24
24
|
renderSuccess,
|
|
25
25
|
renderUnexpectedError,
|
|
26
26
|
resolveEffectiveConfig
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-UPNQPAJG.js";
|
|
28
28
|
import {
|
|
29
29
|
GLOBAL_FLAGS
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-QQRTODHN.js";
|
|
31
31
|
|
|
32
32
|
// src/commands/sales-nav.ts
|
|
33
33
|
import { defineCommand } from "citty";
|
|
@@ -14,10 +14,10 @@ import {
|
|
|
14
14
|
renderSuccess,
|
|
15
15
|
renderUnexpectedError,
|
|
16
16
|
resolveEffectiveConfig
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-UPNQPAJG.js";
|
|
18
18
|
import {
|
|
19
19
|
GLOBAL_FLAGS
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-QQRTODHN.js";
|
|
21
21
|
|
|
22
22
|
// src/commands/search.ts
|
|
23
23
|
import { defineCommand } from "citty";
|
|
@@ -11,10 +11,10 @@ import {
|
|
|
11
11
|
renderSuccess,
|
|
12
12
|
renderUnexpectedError,
|
|
13
13
|
resolveEffectiveConfig
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-UPNQPAJG.js";
|
|
15
15
|
import {
|
|
16
16
|
GLOBAL_FLAGS
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-QQRTODHN.js";
|
|
18
18
|
|
|
19
19
|
// src/commands/webhook.ts
|
|
20
20
|
import { defineCommand } from "citty";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@curviate/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Official command-line interface for the Curviate API.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"homepage": "https://docs.curviate.com",
|
|
9
9
|
"repository": {
|
|
10
10
|
"type": "git",
|
|
11
|
-
"url": "https://github.com/curviate/cli.git"
|
|
11
|
+
"url": "git+https://github.com/curviate/cli.git"
|
|
12
12
|
},
|
|
13
13
|
"bugs": {
|
|
14
14
|
"url": "https://github.com/curviate/cli/issues"
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"access": "public"
|
|
18
18
|
},
|
|
19
19
|
"bin": {
|
|
20
|
-
"curviate": "
|
|
20
|
+
"curviate": "dist/cli.js"
|
|
21
21
|
},
|
|
22
22
|
"files": [
|
|
23
23
|
"dist/",
|
|
@@ -40,15 +40,15 @@
|
|
|
40
40
|
"clean": "rm -rf dist *.tsbuildinfo"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@curviate/sdk": "^0.
|
|
43
|
+
"@curviate/sdk": "^0.2.0",
|
|
44
44
|
"citty": "^0.1.6"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"@types/node": "^22.15.21",
|
|
48
48
|
"eslint": "^9.0.0",
|
|
49
|
-
"typescript-eslint": "^8.0.0",
|
|
50
49
|
"tsup": "^8.3.5",
|
|
51
50
|
"typescript": "^5.7.2",
|
|
51
|
+
"typescript-eslint": "^8.0.0",
|
|
52
52
|
"vitest": "^3.2.2"
|
|
53
53
|
}
|
|
54
54
|
}
|