@curviate/cli 0.14.0 → 0.15.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 +104 -0
- package/README.md +52 -79
- package/dist/{account-7AUDAMIK.js → account-VB52GIUA.js} +34 -369
- package/dist/{chunk-SSPILTKF.js → chunk-45KHSWCV.js} +56 -48
- package/dist/chunk-BGZW6B7G.js +59 -0
- package/dist/{chunk-GXTZION6.js → chunk-DNTRQZBT.js} +13 -1
- package/dist/chunk-QJZ3LWOX.js +24 -0
- package/dist/{chunk-HMAGEMF7.js → chunk-ZE7QGR3F.js} +4 -0
- package/dist/cli.js +75 -12
- package/dist/comment-Y5IU42CR.js +550 -0
- package/dist/{company-RU2CA5DY.js → company-LGID3SK3.js} +21 -72
- package/dist/{connect-QT6ZOS75.js → connect-A7HEKKEE.js} +86 -43
- package/dist/{exit-codes-ZTY2NY3X.js → exit-codes-SL3GQF7W.js} +1 -1
- package/dist/{inbox-DN7X7CM2.js → inbox-44JRTJAP.js} +50 -122
- package/dist/job-TFTTCP5B.js +561 -0
- package/dist/{message-6K5E3CUF.js → message-FOJTDPW3.js} +47 -47
- package/dist/{post-2JQZ3OSF.js → post-FC6NZXM5.js} +177 -219
- package/dist/profile-I6YMVXSS.js +799 -0
- package/dist/{recruiter-XHVMQWK6.js → recruiter-BHT5OJD7.js} +731 -224
- package/dist/{sales-nav-QTSTJMKA.js → sales-nav-6IYKQ4TC.js} +109 -75
- package/dist/{search-ZGTS45BT.js → search-6C72M563.js} +95 -37
- package/dist/{webhook-EIY5WWTE.js → webhook-NSXEIU44.js} +4 -43
- package/package.json +4 -3
- package/dist/chunk-Q43HZUN3.js +0 -29
- package/dist/job-FGGQEXSU.js +0 -105
- package/dist/profile-DD5GMGNL.js +0 -501
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
streamAll
|
|
4
|
-
} from "./chunk-GXTZION6.js";
|
|
5
2
|
import {
|
|
6
3
|
slimCompany,
|
|
7
4
|
slimSearchJobs,
|
|
8
5
|
slimSearchPeople,
|
|
9
6
|
slimSearchPosts
|
|
10
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-45KHSWCV.js";
|
|
11
8
|
import {
|
|
12
9
|
resolveIdentifier
|
|
13
10
|
} from "./chunk-DMQZEPQE.js";
|
|
11
|
+
import {
|
|
12
|
+
streamAll
|
|
13
|
+
} from "./chunk-DNTRQZBT.js";
|
|
14
14
|
import {
|
|
15
15
|
createClient,
|
|
16
16
|
renderError,
|
|
@@ -51,10 +51,16 @@ function resolveOutputOpts(flags) {
|
|
|
51
51
|
verbose: flags.verbose ?? false
|
|
52
52
|
};
|
|
53
53
|
}
|
|
54
|
+
async function resolveCompanyId(ns, raw) {
|
|
55
|
+
const normalized = resolveIdentifier(raw);
|
|
56
|
+
if (/^\d+$/.test(normalized)) return normalized;
|
|
57
|
+
const company = await ns.companies.get(normalized);
|
|
58
|
+
return String(company.id);
|
|
59
|
+
}
|
|
54
60
|
async function handleSdkError(err, outOpts, out) {
|
|
55
61
|
const { CurviateError } = await import("@curviate/sdk");
|
|
56
62
|
if (err instanceof CurviateError) {
|
|
57
|
-
const { getExitCode } = await import("./exit-codes-
|
|
63
|
+
const { getExitCode } = await import("./exit-codes-SL3GQF7W.js");
|
|
58
64
|
renderError(err, outOpts, out);
|
|
59
65
|
process.exit(getExitCode(err.code));
|
|
60
66
|
}
|
|
@@ -85,7 +91,6 @@ async function runCompanyGet(client, flags, out) {
|
|
|
85
91
|
async function runCompanyEmployees(client, flags, out) {
|
|
86
92
|
rejectPreviewOnRead(flags.preview, out);
|
|
87
93
|
const accountId = requireAccount(flags.account, out);
|
|
88
|
-
const identifier = flags.id ?? "";
|
|
89
94
|
const ns = client.account(accountId);
|
|
90
95
|
const outOpts = resolveOutputOpts(flags);
|
|
91
96
|
const params = {};
|
|
@@ -94,13 +99,13 @@ async function runCompanyEmployees(client, flags, out) {
|
|
|
94
99
|
if (flags.keywords) params["keywords"] = flags.keywords;
|
|
95
100
|
if (flags.location) params["location"] = flags.location;
|
|
96
101
|
try {
|
|
102
|
+
const identifier = await resolveCompanyId(ns, flags.id ?? "");
|
|
97
103
|
if (flags.all) {
|
|
98
104
|
const maxPages = flags["max-pages"] ? parseInt(flags["max-pages"], 10) : 100;
|
|
99
105
|
const fn = (p) => ns.companies.employees(identifier, p);
|
|
100
106
|
for await (const item of streamAll(fn, params, {
|
|
101
107
|
maxPages,
|
|
102
|
-
|
|
103
|
-
`)
|
|
108
|
+
out
|
|
104
109
|
})) {
|
|
105
110
|
out.stdout.write(JSON.stringify(item) + "\n");
|
|
106
111
|
}
|
|
@@ -115,20 +120,19 @@ async function runCompanyEmployees(client, flags, out) {
|
|
|
115
120
|
async function runCompanyPosts(client, flags, out) {
|
|
116
121
|
rejectPreviewOnRead(flags.preview, out);
|
|
117
122
|
const accountId = requireAccount(flags.account, out);
|
|
118
|
-
const identifier = flags.id ?? "";
|
|
119
123
|
const ns = client.account(accountId);
|
|
120
124
|
const outOpts = resolveOutputOpts(flags);
|
|
121
125
|
const params = {};
|
|
122
126
|
if (flags.limit) params["limit"] = parseInt(flags.limit, 10);
|
|
123
127
|
if (flags.cursor) params["cursor"] = flags.cursor;
|
|
124
128
|
try {
|
|
129
|
+
const identifier = await resolveCompanyId(ns, flags.id ?? "");
|
|
125
130
|
if (flags.all) {
|
|
126
131
|
const maxPages = flags["max-pages"] ? parseInt(flags["max-pages"], 10) : 100;
|
|
127
132
|
const fn = (p) => ns.companies.posts(identifier, p);
|
|
128
133
|
for await (const item of streamAll(fn, params, {
|
|
129
134
|
maxPages,
|
|
130
|
-
|
|
131
|
-
`)
|
|
135
|
+
out
|
|
132
136
|
})) {
|
|
133
137
|
out.stdout.write(JSON.stringify(item) + "\n");
|
|
134
138
|
}
|
|
@@ -143,7 +147,6 @@ async function runCompanyPosts(client, flags, out) {
|
|
|
143
147
|
async function runCompanyJobs(client, flags, out) {
|
|
144
148
|
rejectPreviewOnRead(flags.preview, out);
|
|
145
149
|
const accountId = requireAccount(flags.account, out);
|
|
146
|
-
const identifier = flags.id ?? "";
|
|
147
150
|
const ns = client.account(accountId);
|
|
148
151
|
const outOpts = resolveOutputOpts(flags);
|
|
149
152
|
const params = {};
|
|
@@ -151,13 +154,13 @@ async function runCompanyJobs(client, flags, out) {
|
|
|
151
154
|
if (flags.cursor) params["cursor"] = flags.cursor;
|
|
152
155
|
if (flags.keywords) params["keywords"] = flags.keywords;
|
|
153
156
|
try {
|
|
157
|
+
const identifier = await resolveCompanyId(ns, flags.id ?? "");
|
|
154
158
|
if (flags.all) {
|
|
155
159
|
const maxPages = flags["max-pages"] ? parseInt(flags["max-pages"], 10) : 100;
|
|
156
160
|
const fn = (p) => ns.companies.jobs(identifier, p);
|
|
157
161
|
for await (const item of streamAll(fn, params, {
|
|
158
162
|
maxPages,
|
|
159
|
-
|
|
160
|
-
`)
|
|
163
|
+
out
|
|
161
164
|
})) {
|
|
162
165
|
out.stdout.write(JSON.stringify(item) + "\n");
|
|
163
166
|
}
|
|
@@ -169,39 +172,11 @@ async function runCompanyJobs(client, flags, out) {
|
|
|
169
172
|
await handleSdkError(err, outOpts, out);
|
|
170
173
|
}
|
|
171
174
|
}
|
|
172
|
-
async function runCompanyFollowers(client, flags, out) {
|
|
173
|
-
rejectPreviewOnRead(flags.preview, out);
|
|
174
|
-
const accountId = requireAccount(flags.account, out);
|
|
175
|
-
const identifier = flags.id ?? "";
|
|
176
|
-
const ns = client.account(accountId);
|
|
177
|
-
const outOpts = resolveOutputOpts(flags);
|
|
178
|
-
const params = {};
|
|
179
|
-
if (flags.limit) params["limit"] = parseInt(flags.limit, 10);
|
|
180
|
-
if (flags.cursor) params["cursor"] = flags.cursor;
|
|
181
|
-
try {
|
|
182
|
-
if (flags.all) {
|
|
183
|
-
const maxPages = flags["max-pages"] ? parseInt(flags["max-pages"], 10) : 100;
|
|
184
|
-
const fn = (p) => ns.companies.followers(identifier, p);
|
|
185
|
-
for await (const item of streamAll(fn, params, {
|
|
186
|
-
maxPages,
|
|
187
|
-
onTruncated: (n) => out.stderr.write(`Streaming truncated at ${n} page(s). Use --all --max-pages or --cursor for manual paging.
|
|
188
|
-
`)
|
|
189
|
-
})) {
|
|
190
|
-
out.stdout.write(JSON.stringify(item) + "\n");
|
|
191
|
-
}
|
|
192
|
-
return;
|
|
193
|
-
}
|
|
194
|
-
const result = await ns.companies.followers(identifier, params);
|
|
195
|
-
renderSuccess(result, outOpts, out);
|
|
196
|
-
} catch (err) {
|
|
197
|
-
await handleSdkError(err, outOpts, out);
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
175
|
var companyEmployeesCommand = defineCommand({
|
|
201
176
|
meta: { name: "employees", description: "List people who currently work at the company." },
|
|
202
177
|
args: {
|
|
203
178
|
...GLOBAL_FLAGS,
|
|
204
|
-
id: { type: "positional", description: "
|
|
179
|
+
id: { type: "positional", description: "Company identifier (URL, slug, or numeric id) \u2014 a slug/URL is resolved to the numeric id first." },
|
|
205
180
|
keywords: { type: "string", description: "Free-text keyword filter across employee profile fields." },
|
|
206
181
|
location: { type: "string", description: "Opaque location id from `search parameters --type LOCATION`." }
|
|
207
182
|
},
|
|
@@ -227,7 +202,7 @@ var companyPostsCommand = defineCommand({
|
|
|
227
202
|
meta: { name: "posts", description: "List the company's posts." },
|
|
228
203
|
args: {
|
|
229
204
|
...GLOBAL_FLAGS,
|
|
230
|
-
id: { type: "positional", description: "
|
|
205
|
+
id: { type: "positional", description: "Company identifier (URL, slug, or numeric id) \u2014 a slug/URL is resolved to the numeric id first." }
|
|
231
206
|
},
|
|
232
207
|
async run({ args }) {
|
|
233
208
|
const flags = args;
|
|
@@ -251,7 +226,7 @@ var companyJobsCommand = defineCommand({
|
|
|
251
226
|
meta: { name: "jobs", description: "List the company's open job postings." },
|
|
252
227
|
args: {
|
|
253
228
|
...GLOBAL_FLAGS,
|
|
254
|
-
id: { type: "positional", description: "
|
|
229
|
+
id: { type: "positional", description: "Company identifier (URL, slug, or numeric id) \u2014 a slug/URL is resolved to the numeric id first." },
|
|
255
230
|
keywords: { type: "string", description: "Free-text keyword filter across job postings." }
|
|
256
231
|
},
|
|
257
232
|
async run({ args }) {
|
|
@@ -272,30 +247,6 @@ var companyJobsCommand = defineCommand({
|
|
|
272
247
|
await runCompanyJobs(client, { ...flags, account: flags.account ?? cfg.account }, out);
|
|
273
248
|
}
|
|
274
249
|
});
|
|
275
|
-
var companyFollowersCommand = defineCommand({
|
|
276
|
-
meta: { name: "followers", description: "List the company's followers. Requires page-admin permission." },
|
|
277
|
-
args: {
|
|
278
|
-
...GLOBAL_FLAGS,
|
|
279
|
-
id: { type: "positional", description: "The company's numeric provider_id (the id field of `company <id>`)." }
|
|
280
|
-
},
|
|
281
|
-
async run({ args }) {
|
|
282
|
-
const flags = args;
|
|
283
|
-
const cfg = await resolveEffectiveConfig({
|
|
284
|
-
apiKey: flags["api-key"],
|
|
285
|
-
baseUrl: flags["base-url"],
|
|
286
|
-
timeout: flags.timeout,
|
|
287
|
-
account: flags.account,
|
|
288
|
-
profile: flags.profile
|
|
289
|
-
});
|
|
290
|
-
if (!cfg.apiKey) {
|
|
291
|
-
process.stderr.write("error: no API key \u2014 run `curviate login` or pass --api-key.\n");
|
|
292
|
-
process.exit(3);
|
|
293
|
-
}
|
|
294
|
-
const client = createClient({ apiKey: cfg.apiKey, baseUrl: cfg.baseUrl, timeout: cfg.timeout });
|
|
295
|
-
const out = buildOutputStreams();
|
|
296
|
-
await runCompanyFollowers(client, { ...flags, account: flags.account ?? cfg.account }, out);
|
|
297
|
-
}
|
|
298
|
-
});
|
|
299
250
|
var companyCommand = defineCommand({
|
|
300
251
|
meta: { name: "company", description: "Fetch a company profile by URL, slug, or numeric id, and its sub-resources." },
|
|
301
252
|
args: {
|
|
@@ -306,8 +257,7 @@ var companyCommand = defineCommand({
|
|
|
306
257
|
subCommands: {
|
|
307
258
|
employees: companyEmployeesCommand,
|
|
308
259
|
posts: companyPostsCommand,
|
|
309
|
-
jobs: companyJobsCommand
|
|
310
|
-
followers: companyFollowersCommand
|
|
260
|
+
jobs: companyJobsCommand
|
|
311
261
|
},
|
|
312
262
|
async run({ args }) {
|
|
313
263
|
const flags = args;
|
|
@@ -330,7 +280,6 @@ var companyCommand = defineCommand({
|
|
|
330
280
|
export {
|
|
331
281
|
companyCommand,
|
|
332
282
|
runCompanyEmployees,
|
|
333
|
-
runCompanyFollowers,
|
|
334
283
|
runCompanyGet,
|
|
335
284
|
runCompanyJobs,
|
|
336
285
|
runCompanyPosts
|
|
@@ -2,18 +2,18 @@
|
|
|
2
2
|
import {
|
|
3
3
|
buildPreviewOutput
|
|
4
4
|
} from "./chunk-R3VLWLVV.js";
|
|
5
|
-
import {
|
|
6
|
-
streamAll
|
|
7
|
-
} from "./chunk-GXTZION6.js";
|
|
8
5
|
import {
|
|
9
6
|
slimInviteReceived,
|
|
10
7
|
slimInviteReceivedItem,
|
|
11
8
|
slimInviteSent,
|
|
12
9
|
slimInviteSentItem
|
|
13
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-45KHSWCV.js";
|
|
14
11
|
import {
|
|
15
12
|
resolveIdentifier
|
|
16
13
|
} from "./chunk-DMQZEPQE.js";
|
|
14
|
+
import {
|
|
15
|
+
streamAll
|
|
16
|
+
} from "./chunk-DNTRQZBT.js";
|
|
17
17
|
import {
|
|
18
18
|
createClient,
|
|
19
19
|
renderError,
|
|
@@ -59,8 +59,10 @@ async function runConnectSend(client, flags, out) {
|
|
|
59
59
|
const accountId = requireAccount(flags.account, out);
|
|
60
60
|
const rawId = flags.id ?? "";
|
|
61
61
|
const resolvedId = resolveIdentifier(rawId);
|
|
62
|
-
const body = {
|
|
63
|
-
|
|
62
|
+
const body = {
|
|
63
|
+
recipient_identifier: resolvedId,
|
|
64
|
+
...flags.note ? { message: flags.note } : {}
|
|
65
|
+
};
|
|
64
66
|
if (flags.preview) {
|
|
65
67
|
const preview = buildPreviewOutput({
|
|
66
68
|
method: "invites.send",
|
|
@@ -79,7 +81,7 @@ async function runConnectSend(client, flags, out) {
|
|
|
79
81
|
} catch (err) {
|
|
80
82
|
const { CurviateError } = await import("@curviate/sdk");
|
|
81
83
|
if (err instanceof CurviateError) {
|
|
82
|
-
const { getExitCode } = await import("./exit-codes-
|
|
84
|
+
const { getExitCode } = await import("./exit-codes-SL3GQF7W.js");
|
|
83
85
|
renderError(err, outOpts, out);
|
|
84
86
|
process.exit(getExitCode(err.code));
|
|
85
87
|
}
|
|
@@ -104,8 +106,7 @@ async function runConnectSent(client, flags, out) {
|
|
|
104
106
|
const fn = (p) => ns.invites.listSent(p);
|
|
105
107
|
for await (const item of streamAll(fn, params, {
|
|
106
108
|
maxPages,
|
|
107
|
-
|
|
108
|
-
`)
|
|
109
|
+
out
|
|
109
110
|
})) {
|
|
110
111
|
const projected = !flags.verbose ? slimInviteSentItem(item) : item;
|
|
111
112
|
out.stdout.write(JSON.stringify(projected) + "\n");
|
|
@@ -117,7 +118,7 @@ async function runConnectSent(client, flags, out) {
|
|
|
117
118
|
} catch (err) {
|
|
118
119
|
const { CurviateError } = await import("@curviate/sdk");
|
|
119
120
|
if (err instanceof CurviateError) {
|
|
120
|
-
const { getExitCode } = await import("./exit-codes-
|
|
121
|
+
const { getExitCode } = await import("./exit-codes-SL3GQF7W.js");
|
|
121
122
|
renderError(err, outOpts, out);
|
|
122
123
|
process.exit(getExitCode(err.code));
|
|
123
124
|
}
|
|
@@ -142,8 +143,7 @@ async function runConnectReceived(client, flags, out) {
|
|
|
142
143
|
const fn = (p) => ns.invites.listReceived(p);
|
|
143
144
|
for await (const item of streamAll(fn, params, {
|
|
144
145
|
maxPages,
|
|
145
|
-
|
|
146
|
-
`)
|
|
146
|
+
out
|
|
147
147
|
})) {
|
|
148
148
|
const projected = !flags.verbose ? slimInviteReceivedItem(item) : item;
|
|
149
149
|
out.stdout.write(JSON.stringify(projected) + "\n");
|
|
@@ -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-SL3GQF7W.js");
|
|
159
159
|
renderError(err, outOpts, out);
|
|
160
160
|
process.exit(getExitCode(err.code));
|
|
161
161
|
}
|
|
@@ -163,23 +163,43 @@ async function runConnectReceived(client, flags, out) {
|
|
|
163
163
|
process.exit(1);
|
|
164
164
|
}
|
|
165
165
|
}
|
|
166
|
-
async function
|
|
166
|
+
async function runConnectAccept(client, flags, out) {
|
|
167
167
|
const accountId = requireAccount(flags.account, out);
|
|
168
168
|
const invitationId = flags.id ?? "";
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
169
|
+
if (flags.preview) {
|
|
170
|
+
const preview = buildPreviewOutput({
|
|
171
|
+
method: "invites.accept",
|
|
172
|
+
args: { invitation_id: invitationId },
|
|
173
|
+
body: {},
|
|
174
|
+
account: accountId
|
|
175
|
+
});
|
|
176
|
+
out.stdout.write(JSON.stringify(preview) + "\n");
|
|
177
|
+
return;
|
|
176
178
|
}
|
|
177
|
-
const
|
|
179
|
+
const ns = client.account(accountId);
|
|
180
|
+
const outOpts = resolveOutputOpts(flags);
|
|
181
|
+
try {
|
|
182
|
+
const result = await ns.invites.accept(invitationId);
|
|
183
|
+
renderSuccess(result, outOpts, out);
|
|
184
|
+
} catch (err) {
|
|
185
|
+
const { CurviateError } = await import("@curviate/sdk");
|
|
186
|
+
if (err instanceof CurviateError) {
|
|
187
|
+
const { getExitCode } = await import("./exit-codes-SL3GQF7W.js");
|
|
188
|
+
renderError(err, outOpts, out);
|
|
189
|
+
process.exit(getExitCode(err.code));
|
|
190
|
+
}
|
|
191
|
+
renderUnexpectedError(err, out);
|
|
192
|
+
process.exit(1);
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
async function runConnectDecline(client, flags, out) {
|
|
196
|
+
const accountId = requireAccount(flags.account, out);
|
|
197
|
+
const invitationId = flags.id ?? "";
|
|
178
198
|
if (flags.preview) {
|
|
179
199
|
const preview = buildPreviewOutput({
|
|
180
|
-
method: "invites.
|
|
200
|
+
method: "invites.decline",
|
|
181
201
|
args: { invitation_id: invitationId },
|
|
182
|
-
body,
|
|
202
|
+
body: {},
|
|
183
203
|
account: accountId
|
|
184
204
|
});
|
|
185
205
|
out.stdout.write(JSON.stringify(preview) + "\n");
|
|
@@ -188,12 +208,12 @@ async function runConnectRespond(client, flags, out) {
|
|
|
188
208
|
const ns = client.account(accountId);
|
|
189
209
|
const outOpts = resolveOutputOpts(flags);
|
|
190
210
|
try {
|
|
191
|
-
const result = await ns.invites.
|
|
211
|
+
const result = await ns.invites.decline(invitationId);
|
|
192
212
|
renderSuccess(result, outOpts, out);
|
|
193
213
|
} catch (err) {
|
|
194
214
|
const { CurviateError } = await import("@curviate/sdk");
|
|
195
215
|
if (err instanceof CurviateError) {
|
|
196
|
-
const { getExitCode } = await import("./exit-codes-
|
|
216
|
+
const { getExitCode } = await import("./exit-codes-SL3GQF7W.js");
|
|
197
217
|
renderError(err, outOpts, out);
|
|
198
218
|
process.exit(getExitCode(err.code));
|
|
199
219
|
}
|
|
@@ -222,7 +242,7 @@ async function runConnectCancel(client, flags, out) {
|
|
|
222
242
|
} catch (err) {
|
|
223
243
|
const { CurviateError } = await import("@curviate/sdk");
|
|
224
244
|
if (err instanceof CurviateError) {
|
|
225
|
-
const { getExitCode } = await import("./exit-codes-
|
|
245
|
+
const { getExitCode } = await import("./exit-codes-SL3GQF7W.js");
|
|
226
246
|
renderError(err, outOpts, out);
|
|
227
247
|
process.exit(getExitCode(err.code));
|
|
228
248
|
}
|
|
@@ -233,7 +253,7 @@ async function runConnectCancel(client, flags, out) {
|
|
|
233
253
|
var connectSentCommand = defineCommand({
|
|
234
254
|
meta: {
|
|
235
255
|
name: "sent",
|
|
236
|
-
description: "Returns pending sent invitations only \u2014 accepted and declined invitations are not returned (LinkedIn API limitation). Use `id` with `connect cancel`; use `
|
|
256
|
+
description: "Returns pending sent invitations only \u2014 accepted and declined invitations are not returned (LinkedIn API limitation). Use `id` with `connect cancel`; use `user.id` (native member URN \u2014 the sent-variant carries no public slug) to identify the recipient. `created_at` is the platform's own ISO-8601 timestamp (not an approximation). No total count is available; use `connect sent --all` and count client-side."
|
|
237
257
|
},
|
|
238
258
|
args: { ...GLOBAL_FLAGS },
|
|
239
259
|
async run({ args }) {
|
|
@@ -257,7 +277,7 @@ var connectSentCommand = defineCommand({
|
|
|
257
277
|
var connectReceivedCommand = defineCommand({
|
|
258
278
|
meta: {
|
|
259
279
|
name: "received",
|
|
260
|
-
description: "Returns pending received invitations only \u2014 already-handled invitations are not returned. The `
|
|
280
|
+
description: "Returns pending received invitations only \u2014 already-handled invitations are not returned. The `user.*` fields (`public_identifier`, `display_name`, `first_name`, `last_name`) identify who sent the request. Use the `id` field with `connect accept` or `connect decline`."
|
|
261
281
|
},
|
|
262
282
|
args: { ...GLOBAL_FLAGS },
|
|
263
283
|
async run({ args }) {
|
|
@@ -278,19 +298,40 @@ var connectReceivedCommand = defineCommand({
|
|
|
278
298
|
await runConnectReceived(client, { ...flags, account: flags.account ?? cfg.account }, out);
|
|
279
299
|
}
|
|
280
300
|
});
|
|
281
|
-
var
|
|
282
|
-
meta: { name: "
|
|
301
|
+
var connectAcceptCommand = defineCommand({
|
|
302
|
+
meta: { name: "accept", description: "Accept a received invitation." },
|
|
283
303
|
args: {
|
|
284
304
|
...WRITE_FLAGS,
|
|
285
305
|
id: {
|
|
286
306
|
type: "positional",
|
|
287
|
-
description: "Invitation id to
|
|
288
|
-
}
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
307
|
+
description: "Invitation id to accept \u2014 use the `id` field from `connect received`."
|
|
308
|
+
}
|
|
309
|
+
},
|
|
310
|
+
async run({ args }) {
|
|
311
|
+
const flags = args;
|
|
312
|
+
const cfg = await resolveEffectiveConfig({
|
|
313
|
+
apiKey: flags["api-key"],
|
|
314
|
+
baseUrl: flags["base-url"],
|
|
315
|
+
timeout: flags.timeout,
|
|
316
|
+
account: flags.account,
|
|
317
|
+
profile: flags.profile
|
|
318
|
+
});
|
|
319
|
+
if (!cfg.apiKey) {
|
|
320
|
+
process.stderr.write("error: no API key \u2014 run `curviate login` or pass --api-key.\n");
|
|
321
|
+
process.exit(3);
|
|
322
|
+
}
|
|
323
|
+
const client = createClient({ apiKey: cfg.apiKey, baseUrl: cfg.baseUrl, timeout: cfg.timeout });
|
|
324
|
+
const out = buildOutputStreams();
|
|
325
|
+
await runConnectAccept(client, { ...flags, account: flags.account ?? cfg.account }, out);
|
|
326
|
+
}
|
|
327
|
+
});
|
|
328
|
+
var connectDeclineCommand = defineCommand({
|
|
329
|
+
meta: { name: "decline", description: "Decline a received invitation." },
|
|
330
|
+
args: {
|
|
331
|
+
...WRITE_FLAGS,
|
|
332
|
+
id: {
|
|
333
|
+
type: "positional",
|
|
334
|
+
description: "Invitation id to decline \u2014 use the `id` field from `connect received`."
|
|
294
335
|
}
|
|
295
336
|
},
|
|
296
337
|
async run({ args }) {
|
|
@@ -308,7 +349,7 @@ var connectRespondCommand = defineCommand({
|
|
|
308
349
|
}
|
|
309
350
|
const client = createClient({ apiKey: cfg.apiKey, baseUrl: cfg.baseUrl, timeout: cfg.timeout });
|
|
310
351
|
const out = buildOutputStreams();
|
|
311
|
-
await
|
|
352
|
+
await runConnectDecline(client, { ...flags, account: flags.account ?? cfg.account }, out);
|
|
312
353
|
}
|
|
313
354
|
});
|
|
314
355
|
var connectCancelCommand = defineCommand({
|
|
@@ -355,16 +396,17 @@ var connectCommand = defineCommand({
|
|
|
355
396
|
subCommands: {
|
|
356
397
|
sent: connectSentCommand,
|
|
357
398
|
received: connectReceivedCommand,
|
|
358
|
-
|
|
399
|
+
accept: connectAcceptCommand,
|
|
400
|
+
decline: connectDeclineCommand,
|
|
359
401
|
cancel: connectCancelCommand
|
|
360
402
|
},
|
|
361
403
|
async run({ args }) {
|
|
362
404
|
const flags = args;
|
|
363
405
|
if (!flags.id) {
|
|
364
406
|
process.stderr.write(
|
|
365
|
-
"Usage: curviate connect <id> [--note <text>]\n curviate connect sent\n curviate connect received\n curviate connect
|
|
407
|
+
"Usage: curviate connect <id> [--note <text>]\n curviate connect sent\n curviate connect received\n curviate connect accept <invitation_id>\n curviate connect decline <invitation_id>\n curviate connect cancel <invitation_id>\n"
|
|
366
408
|
);
|
|
367
|
-
|
|
409
|
+
process.exit(2);
|
|
368
410
|
}
|
|
369
411
|
const cfg = await resolveEffectiveConfig({
|
|
370
412
|
apiKey: flags["api-key"],
|
|
@@ -384,9 +426,10 @@ var connectCommand = defineCommand({
|
|
|
384
426
|
});
|
|
385
427
|
export {
|
|
386
428
|
connectCommand,
|
|
429
|
+
runConnectAccept,
|
|
387
430
|
runConnectCancel,
|
|
431
|
+
runConnectDecline,
|
|
388
432
|
runConnectReceived,
|
|
389
|
-
runConnectRespond,
|
|
390
433
|
runConnectSend,
|
|
391
434
|
runConnectSent
|
|
392
435
|
};
|