@curviate/cli 0.26.0 → 0.27.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 +70 -0
- package/README.md +58 -0
- package/dist/{account-ZNBG7C3J.js → account-5KGM6EPR.js} +4 -4
- package/dist/{chunk-RPRIMRIU.js → chunk-2OG6M6ME.js} +11 -0
- package/dist/{chunk-PMWEDWJ3.js → chunk-5KANHEBN.js} +38 -5
- package/dist/{chunk-RZ36UBML.js → chunk-63X3VI3T.js} +5 -2
- package/dist/{chunk-RJTG5YWE.js → chunk-6P52Q2GK.js} +2 -2
- package/dist/{chunk-V75UFUF2.js → chunk-GHT2DLZR.js} +1 -1
- package/dist/chunk-PQWDDSV7.js +65 -0
- package/dist/{chunk-KTKKZGJV.js → chunk-TAOXJNQN.js} +3 -3
- package/dist/cli.js +17 -17
- package/dist/{comment-TTOQPMSO.js → comment-BLG4WHST.js} +6 -6
- package/dist/{company-HD3WIYP6.js → company-ZT65QZ6F.js} +6 -6
- package/dist/{connect-Y2FWUXDA.js → connect-57AUN33D.js} +10 -10
- package/dist/{exit-codes-4RCNQJUB.js → exit-codes-U5CHA6FT.js} +1 -1
- package/dist/{feed-I7QG7Y2Y.js → feed-3AWI2URQ.js} +5 -5
- package/dist/{group-RXZVIOTU.js → group-DYC2NX5M.js} +5 -5
- package/dist/{inbox-25JJBITH.js → inbox-CQO2I47N.js} +25 -7
- package/dist/{inboxes-CD3OVL76.js → inboxes-XQ2B6X3Q.js} +5 -5
- package/dist/{job-ITLUWM3G.js → job-NUT4QMH2.js} +5 -5
- package/dist/{message-WNYEHK2B.js → message-KMNRUD4H.js} +4 -4
- package/dist/{notification-5PETFBMH.js → notification-LEM57IBY.js} +5 -5
- package/dist/{post-7IROSWFO.js → post-FXAANNUB.js} +6 -6
- package/dist/{profile-MF5L5BTE.js → profile-72V55PZM.js} +40 -13
- package/dist/{recruiter-24BX6WU3.js → recruiter-JUNB5AUR.js} +5 -5
- package/dist/{sales-nav-3EY4H6MR.js → sales-nav-BALVVD35.js} +5 -5
- package/dist/{search-UPYL2NB6.js → search-QCXTK33P.js} +13 -13
- package/dist/{webhook-SUCCPKXZ.js → webhook-D4QRWF7W.js} +3 -3
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,76 @@ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
|
|
6
6
|
Versioning follows [Semantic Versioning](https://semver.org/spec/v2.0.0.html):
|
|
7
7
|
a new command or flag is a minor; a breaking command/flag/exit-code change is a major; a fix is a patch.
|
|
8
8
|
|
|
9
|
+
## [0.27.0] - 2026-09-06
|
|
10
|
+
|
|
11
|
+
Pins `@curviate/sdk` at `0.26.0`, which is what makes the last two items of
|
|
12
|
+
this release possible: `inbox get` can carry the retrieval pair, and exit `14`
|
|
13
|
+
is reachable. No command, flag or exit code changes meaning.
|
|
14
|
+
|
|
15
|
+
### Added
|
|
16
|
+
|
|
17
|
+
- **`--mode` and `--max-age` on the reads that can be served from a stored
|
|
18
|
+
copy.** `--mode auto|live|refill|cache_only` says how willing a read is to
|
|
19
|
+
reach LinkedIn; `--max-age <seconds>` sets the oldest stored copy it will
|
|
20
|
+
accept and overrides the `auto`, `live` and `refill` presets in both
|
|
21
|
+
directions. Available on `profile <id>`, `profile me`, `inbox get` and
|
|
22
|
+
`inbox messages`, the four reads the API declares them on. The activity listings on the profile
|
|
23
|
+
commands (`--posts`, `--comments`, `--reactions`, `--followers`) reject them
|
|
24
|
+
with exit `2` rather than sending a parameter their endpoints answer with a
|
|
25
|
+
`400`.
|
|
26
|
+
- **Client-side validation, before any request is sent.** An unknown `--mode`,
|
|
27
|
+
a `--max-age` that is not a whole number from `0` to `31536000`, or
|
|
28
|
+
`--mode cache_only` combined with `--max-age` is a usage error (exit `2`)
|
|
29
|
+
with nothing transmitted. The last of those mirrors the API: `cache_only`
|
|
30
|
+
never reaches LinkedIn at any age, so a freshness threshold cannot change
|
|
31
|
+
its answer, and the pair is refused rather than one of the two being
|
|
32
|
+
silently ignored.
|
|
33
|
+
- **Provenance on the response.** These reads carry `source` (`store` or
|
|
34
|
+
`live`) and `observed_at`, plus `withdrawn`/`withdrawn_at` when the platform
|
|
35
|
+
says the resource is gone. All of them now survive `--fields` and the slim
|
|
36
|
+
projection, which previously dropped them (both layers rebuild output from an
|
|
37
|
+
allowlist). In human mode the same facts go to stderr as a one-line
|
|
38
|
+
`provenance:` note, leaving stdout parseable. Under `--all`, where items
|
|
39
|
+
stream as raw NDJSON and never pass through the single-response renderer,
|
|
40
|
+
each page's note goes to stderr the same way page-scoped `notices` already
|
|
41
|
+
do, so the highest-volume read path is not the one that cannot say where its
|
|
42
|
+
data came from. A stored copy can carry less than a live one, so
|
|
43
|
+
`source: "store"` is the signal to re-read with `--mode live` when message
|
|
44
|
+
bodies or contact fields matter.
|
|
45
|
+
- **Exit code `14`, nothing stored.** `NOT_STORED` answers a
|
|
46
|
+
`--mode cache_only` read the store cannot satisfy. It is deliberately not
|
|
47
|
+
`4`: the resource may exist perfectly well on LinkedIn and this API simply
|
|
48
|
+
holds no copy, so re-checking the id is the wrong move; the fix is another
|
|
49
|
+
mode. A `502` under `cache_only` keeps its existing mapping, because "we
|
|
50
|
+
could not look" and "we hold nothing" are different answers and only one is
|
|
51
|
+
worth retrying.
|
|
52
|
+
|
|
53
|
+
- **The id-resolution pre-call obeys the mode too.** `profile <id> --sections`
|
|
54
|
+
with a slug resolves the slug to a provider id with a first read before the
|
|
55
|
+
enriched one. That pre-call now carries `mode`/`max_age`; previously it went
|
|
56
|
+
out with neither, so `--mode cache_only` reached LinkedIn once before the
|
|
57
|
+
read it was meant to prevent: the mode's only guarantee, broken under a
|
|
58
|
+
`200` with nothing to notice.
|
|
59
|
+
|
|
60
|
+
### Changed
|
|
61
|
+
|
|
62
|
+
- **`@curviate/sdk` pinned at `0.26.0`** (was `0.25.0`), an exact pin as
|
|
63
|
+
always. Two things this release needed shipped there, and both were held
|
|
64
|
+
open by tests written to fail on the day the wait ended:
|
|
65
|
+
- `messaging.getChat(chatId, params?)` takes the retrieval query, so
|
|
66
|
+
**`inbox get` now carries `--mode`/`--max-age`** like the other three
|
|
67
|
+
store-served reads. The chat-id normalization still runs first, so the
|
|
68
|
+
pair rides the bare provider id rather than a thread URL.
|
|
69
|
+
- `NOT_STORED` is in the SDK's error taxonomy, so **exit `14` is now
|
|
70
|
+
reachable**. It previously decoded to `INTERNAL` and the binary answered
|
|
71
|
+
`1`; a `--mode cache_only` read the store cannot satisfy now exits `14`,
|
|
72
|
+
and, because the code is deliberately not retryable, on the first reply
|
|
73
|
+
rather than after a retry loop against an answer that cannot change.
|
|
74
|
+
Nothing else in the SDK bump reaches this binary: the SDK's own type-level
|
|
75
|
+
breaking change (`row` is `string | null` on errors and safety warnings) is
|
|
76
|
+
absorbed by the CLI's existing `typeof === "string"` guard, and the widened
|
|
77
|
+
response enums are read, never exhaustively switched.
|
|
78
|
+
|
|
9
79
|
## [0.26.0] - 2026-09-05
|
|
10
80
|
|
|
11
81
|
### Added
|
package/README.md
CHANGED
|
@@ -442,6 +442,63 @@ curviate recruiter jobs --account acc_1 --limit 10 --json \
|
|
|
442
442
|
curviate recruiter job get "https://www.linkedin.com/jobs/view/4428113858" --account acc_1 --json
|
|
443
443
|
```
|
|
444
444
|
|
|
445
|
+
## Retrieval modes
|
|
446
|
+
|
|
447
|
+
Some reads can be answered from the copy Curviate already holds instead of
|
|
448
|
+
calling LinkedIn. `--mode` says how willing a read is to fetch, and `--max-age`
|
|
449
|
+
sets the oldest stored copy it will accept.
|
|
450
|
+
|
|
451
|
+
| `--mode` | Behaviour |
|
|
452
|
+
|------|---------|
|
|
453
|
+
| `auto` | Default. Serve a stored copy while it is within the resource's freshness threshold, otherwise fetch. |
|
|
454
|
+
| `live` | Always fetch. Same as `--max-age 0`. |
|
|
455
|
+
| `refill` | Serve a stored copy at any age; fetch only when nothing is stored yet. |
|
|
456
|
+
| `cache_only` | Never fetch. A store miss is refused rather than fetched (see the exit-`14` note below). |
|
|
457
|
+
|
|
458
|
+
`--max-age <seconds>` is a whole number from `0` to `31536000` (one year). It
|
|
459
|
+
overrides the `auto`, `live` and `refill` presets in both directions. It cannot
|
|
460
|
+
be combined with `--mode cache_only`, whose guarantee is not a freshness
|
|
461
|
+
threshold: that combination is a usage error (exit `2`) before any request is
|
|
462
|
+
sent.
|
|
463
|
+
|
|
464
|
+
Available on the four reads that can be served from a stored copy:
|
|
465
|
+
`profile <id>`, `profile me`, `inbox get` and `inbox messages`. The activity
|
|
466
|
+
listings on the profile commands (`--posts`, `--comments`, `--reactions`,
|
|
467
|
+
`--followers`) do not accept them and reject them with exit `2`.
|
|
468
|
+
|
|
469
|
+
### Telling a served copy from a fetch
|
|
470
|
+
|
|
471
|
+
Every response from these reads carries `source` (`store` or `live`) and
|
|
472
|
+
`observed_at`, and they survive `--fields` and the slim projection. In human
|
|
473
|
+
mode the same facts go to stderr as a one-line `provenance:` note, so stdout
|
|
474
|
+
stays parseable.
|
|
475
|
+
|
|
476
|
+
A stored copy can carry less than a live one: message bodies and contact fields
|
|
477
|
+
are stripped before anything is stored, so `source: "store"` is the signal to
|
|
478
|
+
re-read with `--mode live` when you need them.
|
|
479
|
+
|
|
480
|
+
### Exit `14`: nothing stored
|
|
481
|
+
|
|
482
|
+
A `--mode cache_only` read the store cannot answer exits `14`. It is not
|
|
483
|
+
"not found" (exit `4`): the resource may exist perfectly well on LinkedIn and
|
|
484
|
+
this API simply holds no copy, so re-checking the id is the wrong move. It is
|
|
485
|
+
not a failure either. The fix is another mode, and it is never worth retrying
|
|
486
|
+
as sent, because the answer cannot change until you change the mode.
|
|
487
|
+
|
|
488
|
+
```bash
|
|
489
|
+
# The default: a fresh stored copy if there is one, otherwise fetch
|
|
490
|
+
curviate profile me --account acc_1 --json
|
|
491
|
+
|
|
492
|
+
# Serve whatever is stored at any age, and fetch only if nothing is
|
|
493
|
+
curviate profile me --account acc_1 --mode refill --json
|
|
494
|
+
|
|
495
|
+
# Accept a stored copy up to five minutes old, otherwise fetch
|
|
496
|
+
curviate profile me --account acc_1 --max-age 300 --fields first_name,source,observed_at --json
|
|
497
|
+
|
|
498
|
+
# A single chat from the store, never LinkedIn. Exit 14 if nothing is stored.
|
|
499
|
+
curviate inbox get 2-AbCdEf== --account acc_1 --mode cache_only --json
|
|
500
|
+
```
|
|
501
|
+
|
|
445
502
|
## Exit codes
|
|
446
503
|
|
|
447
504
|
| Code | Meaning |
|
|
@@ -460,6 +517,7 @@ curviate recruiter job get "https://www.linkedin.com/jobs/view/4428113858" --acc
|
|
|
460
517
|
| 11 | Billing issue (payment required, failed, or seat cancelled) |
|
|
461
518
|
| 12 | Auth action needed (a pending checkpoint; not an error) |
|
|
462
519
|
| 13 | Account-safety budget: Curviate's own ceiling refused the action |
|
|
520
|
+
| 14 | Nothing stored: a `--mode cache_only` read the store cannot answer. Retry with another mode, not with the same request |
|
|
463
521
|
|
|
464
522
|
### 6 and 13 are both `429`, and they need different actions
|
|
465
523
|
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
import {
|
|
11
11
|
pageDelayFromFlags,
|
|
12
12
|
streamAll
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-63X3VI3T.js";
|
|
14
14
|
import {
|
|
15
15
|
buildPreviewOutput
|
|
16
16
|
} from "./chunk-R3VLWLVV.js";
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
renderSuccess,
|
|
21
21
|
renderUnexpectedError,
|
|
22
22
|
resolveEffectiveConfig
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-5KANHEBN.js";
|
|
24
24
|
import "./chunk-KTY7R27U.js";
|
|
25
25
|
import {
|
|
26
26
|
GLOBAL_FLAGS,
|
|
@@ -30,7 +30,7 @@ import {
|
|
|
30
30
|
} from "./chunk-AHYUM2XQ.js";
|
|
31
31
|
import {
|
|
32
32
|
AUTH_NEEDED
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-2OG6M6ME.js";
|
|
34
34
|
|
|
35
35
|
// src/commands/account.ts
|
|
36
36
|
import { defineCommand } from "citty";
|
|
@@ -220,7 +220,7 @@ function resolveOutputOpts(flags) {
|
|
|
220
220
|
async function handleError(err, outOpts, out) {
|
|
221
221
|
const { CurviateError } = await import("@curviate/sdk");
|
|
222
222
|
if (err instanceof CurviateError) {
|
|
223
|
-
const { getExitCode } = await import("./exit-codes-
|
|
223
|
+
const { getExitCode } = await import("./exit-codes-U5CHA6FT.js");
|
|
224
224
|
renderError(err, outOpts, out);
|
|
225
225
|
process.exit(getExitCode(err.code));
|
|
226
226
|
}
|
|
@@ -62,6 +62,17 @@ var EXIT_CODE_MAP = {
|
|
|
62
62
|
SEAT_CANCELLED: 11,
|
|
63
63
|
// Account-safety budget (13), see the note above for why this is not 6
|
|
64
64
|
BUDGET_EXHAUSTED: 13,
|
|
65
|
+
// Nothing stored (14), A NEW BUCKET, and deliberately not 4.
|
|
66
|
+
// `NOT_STORED` is a 422 answering a `--mode cache_only` read: the resource
|
|
67
|
+
// may exist perfectly well on LinkedIn, and this API simply holds no copy of
|
|
68
|
+
// it, so it is NOT "not found" and re-checking the id is the wrong move. It
|
|
69
|
+
// is not 1 either: nothing failed. It is user_fixable and not retryable AS
|
|
70
|
+
// SENT — the fix is another mode (`refill` fetches it once, `auto` fetches
|
|
71
|
+
// now), which is the same shape as exit 2 but reached without a malformed
|
|
72
|
+
// request, so it earns its own number rather than muddying either.
|
|
73
|
+
// A 502 under cache_only stays 7: "we could not look" and "we hold nothing"
|
|
74
|
+
// are different answers and only one of them is worth retrying.
|
|
75
|
+
NOT_STORED: 14,
|
|
65
76
|
// Internal / uncaught (1), last resort bucket
|
|
66
77
|
INTERNAL: 1,
|
|
67
78
|
PLATFORM_NOT_IMPLEMENTED: 1
|
|
@@ -95,13 +95,43 @@ function applyProjection(data, fields) {
|
|
|
95
95
|
}
|
|
96
96
|
return data;
|
|
97
97
|
}
|
|
98
|
+
var isPlain = (v) => typeof v === "object" && v !== null && !Array.isArray(v);
|
|
98
99
|
function withPreservedNotices(original, rendered) {
|
|
99
|
-
const isPlain = (v) => typeof v === "object" && v !== null && !Array.isArray(v);
|
|
100
100
|
if (!isPlain(original) || !isPlain(rendered)) return rendered;
|
|
101
|
+
let out = rendered;
|
|
101
102
|
const notices = original["notices"];
|
|
102
|
-
if (
|
|
103
|
-
|
|
104
|
-
|
|
103
|
+
if (Array.isArray(notices) && notices.length > 0 && rendered["notices"] !== notices) {
|
|
104
|
+
out = { ...out, notices };
|
|
105
|
+
}
|
|
106
|
+
return withPreservedProvenance(original, out);
|
|
107
|
+
}
|
|
108
|
+
var PROVENANCE_KEYS = ["source", "observed_at", "withdrawn", "withdrawn_at"];
|
|
109
|
+
function withPreservedProvenance(original, rendered) {
|
|
110
|
+
if (!isPlain(original) || !isPlain(rendered)) return rendered;
|
|
111
|
+
if (!isRetrievalSource(original["source"])) return rendered;
|
|
112
|
+
const carried = { ...rendered };
|
|
113
|
+
for (const key of PROVENANCE_KEYS) {
|
|
114
|
+
if (Object.prototype.hasOwnProperty.call(original, key)) carried[key] = original[key];
|
|
115
|
+
}
|
|
116
|
+
return carried;
|
|
117
|
+
}
|
|
118
|
+
function isRetrievalSource(v) {
|
|
119
|
+
return v === "store" || v === "live";
|
|
120
|
+
}
|
|
121
|
+
function renderProvenanceNote(data) {
|
|
122
|
+
if (typeof data !== "object" || data === null || Array.isArray(data)) return null;
|
|
123
|
+
const d = data;
|
|
124
|
+
const source = d["source"];
|
|
125
|
+
if (!isRetrievalSource(source)) return null;
|
|
126
|
+
let line = `provenance: source=${source}`;
|
|
127
|
+
const observedAt = d["observed_at"];
|
|
128
|
+
if (typeof observedAt === "string" && observedAt !== "") line += ` observed_at=${observedAt}`;
|
|
129
|
+
if (d["withdrawn"] === true) {
|
|
130
|
+
const withdrawnAt = d["withdrawn_at"];
|
|
131
|
+
line += typeof withdrawnAt === "string" && withdrawnAt !== "" ? ` withdrawn=true withdrawn_at=${withdrawnAt}` : " withdrawn=true";
|
|
132
|
+
}
|
|
133
|
+
if (source === "store") line += " (re-read with --mode live to fetch)";
|
|
134
|
+
return line + "\n";
|
|
105
135
|
}
|
|
106
136
|
function firstProjectableItem(data) {
|
|
107
137
|
const isPlainObject = (v) => typeof v === "object" && v !== null && !Array.isArray(v);
|
|
@@ -132,7 +162,7 @@ function renderSuccess(data, opts, out) {
|
|
|
132
162
|
const json = isJsonMode(opts);
|
|
133
163
|
const fields = opts.fields ? opts.fields.split(",").map((f) => f.trim()).filter(Boolean) : [];
|
|
134
164
|
const slimmed = !opts.verbose && opts.slim ? opts.slim(data) : data;
|
|
135
|
-
const unknownFields = detectUnknownFields(slimmed, fields);
|
|
165
|
+
const unknownFields = detectUnknownFields(withPreservedNotices(data, slimmed), fields);
|
|
136
166
|
if (unknownFields) {
|
|
137
167
|
out.stderr.write(
|
|
138
168
|
`warning: --fields not present on the response: ${unknownFields.unknown.join(", ")}. Available keys: ${unknownFields.available.join(", ")}.
|
|
@@ -143,6 +173,8 @@ function renderSuccess(data, opts, out) {
|
|
|
143
173
|
if (json) {
|
|
144
174
|
out.stdout.write(JSON.stringify(projected) + "\n");
|
|
145
175
|
} else {
|
|
176
|
+
const provenance = renderProvenanceNote(data);
|
|
177
|
+
if (provenance) out.stderr.write(provenance);
|
|
146
178
|
out.stdout.write(renderHuman(projected) + "\n");
|
|
147
179
|
}
|
|
148
180
|
}
|
|
@@ -247,6 +279,7 @@ function renderUnexpectedError(err, out) {
|
|
|
247
279
|
export {
|
|
248
280
|
resolveEffectiveConfig,
|
|
249
281
|
createClient,
|
|
282
|
+
renderProvenanceNote,
|
|
250
283
|
renderSuccess,
|
|
251
284
|
renderNotices,
|
|
252
285
|
renderError,
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
|
-
renderNotices
|
|
4
|
-
|
|
3
|
+
renderNotices,
|
|
4
|
+
renderProvenanceNote
|
|
5
|
+
} from "./chunk-5KANHEBN.js";
|
|
5
6
|
|
|
6
7
|
// src/lib/paginate.ts
|
|
7
8
|
var PaginateError = class extends Error {
|
|
@@ -56,6 +57,8 @@ async function* streamAll(fn, params, opts = {}) {
|
|
|
56
57
|
if (opts.out) {
|
|
57
58
|
const pageNotices = renderNotices(page.notices);
|
|
58
59
|
if (pageNotices) opts.out.stderr.write(pageNotices + "\n");
|
|
60
|
+
const pageProvenance = renderProvenanceNote(page);
|
|
61
|
+
if (pageProvenance) opts.out.stderr.write(pageProvenance);
|
|
59
62
|
}
|
|
60
63
|
if (Array.isArray(items)) {
|
|
61
64
|
for (const item of items) {
|
|
@@ -11,10 +11,10 @@ async function resolveMemberProviderId(ns, raw) {
|
|
|
11
11
|
const profile = await ns.users.get(normalized, {});
|
|
12
12
|
return profile.id;
|
|
13
13
|
}
|
|
14
|
-
async function resolveMemberOrMeProviderId(ns, raw) {
|
|
14
|
+
async function resolveMemberOrMeProviderId(ns, raw, query = {}) {
|
|
15
15
|
const normalized = resolveIdentifier(raw);
|
|
16
16
|
if (normalized === "me" || MEMBER_PROVIDER_ID_RE.test(normalized)) return normalized;
|
|
17
|
-
const profile = await ns.users.get(normalized,
|
|
17
|
+
const profile = await ns.users.get(normalized, query);
|
|
18
18
|
return profile.id;
|
|
19
19
|
}
|
|
20
20
|
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
// src/lib/retrieval.ts
|
|
4
|
+
var RETRIEVAL_MODES = ["live", "auto", "refill", "cache_only"];
|
|
5
|
+
var MAX_AGE_CEILING_SECONDS = 31536e3;
|
|
6
|
+
var RETRIEVAL_FLAGS = {
|
|
7
|
+
mode: {
|
|
8
|
+
type: "string",
|
|
9
|
+
description: "How willing this read is to reach LinkedIn: auto (default, a stored copy while it is fresh), live (always fetch), refill (a stored copy at any age, fetch only when nothing is stored), cache_only (never fetch; a store miss is refused rather than fetched). Not combinable with --max-age under cache_only."
|
|
10
|
+
},
|
|
11
|
+
"max-age": {
|
|
12
|
+
type: "string",
|
|
13
|
+
description: `Maximum age in seconds of a stored copy this read will accept (integer, 0-${MAX_AGE_CEILING_SECONDS}). Overrides the auto/live/refill presets in both directions; 0 is the same as --mode live.`
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
var NON_NEGATIVE_INTEGER = /^\d+$/;
|
|
17
|
+
function hasRetrievalFlags(flags) {
|
|
18
|
+
return flags.mode !== void 0 || flags["max-age"] !== void 0;
|
|
19
|
+
}
|
|
20
|
+
function parseRetrievalFlags(flags) {
|
|
21
|
+
const query = {};
|
|
22
|
+
const rawMode = flags.mode;
|
|
23
|
+
if (rawMode !== void 0) {
|
|
24
|
+
if (!RETRIEVAL_MODES.includes(rawMode)) {
|
|
25
|
+
return {
|
|
26
|
+
ok: false,
|
|
27
|
+
error: `error: --mode must be one of: ${RETRIEVAL_MODES.join(", ")}.` + (rawMode === "" ? " Omit the flag to use the default (auto).\n" : ` Received "${rawMode}".
|
|
28
|
+
`)
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
query.mode = rawMode;
|
|
32
|
+
}
|
|
33
|
+
const rawMaxAge = flags["max-age"];
|
|
34
|
+
if (rawMaxAge !== void 0) {
|
|
35
|
+
if (query.mode === "cache_only") {
|
|
36
|
+
return {
|
|
37
|
+
ok: false,
|
|
38
|
+
error: "error: --mode cache_only cannot be combined with --max-age. cache_only never reaches LinkedIn at any age, so a freshness threshold cannot change its answer. Drop --max-age, or use --mode refill (stored at any age, fetch only when nothing is stored).\n"
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
if (!NON_NEGATIVE_INTEGER.test(rawMaxAge)) {
|
|
42
|
+
return {
|
|
43
|
+
ok: false,
|
|
44
|
+
error: `error: --max-age must be a whole number of seconds (0-${MAX_AGE_CEILING_SECONDS}). Received "${rawMaxAge}".
|
|
45
|
+
`
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
const seconds = Number(rawMaxAge);
|
|
49
|
+
if (seconds > MAX_AGE_CEILING_SECONDS) {
|
|
50
|
+
return {
|
|
51
|
+
ok: false,
|
|
52
|
+
error: `error: --max-age must be at most ${MAX_AGE_CEILING_SECONDS} seconds (one year). Received "${rawMaxAge}".
|
|
53
|
+
`
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
query.max_age = seconds;
|
|
57
|
+
}
|
|
58
|
+
return { ok: true, query };
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export {
|
|
62
|
+
RETRIEVAL_FLAGS,
|
|
63
|
+
hasRetrievalFlags,
|
|
64
|
+
parseRetrievalFlags
|
|
65
|
+
};
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
} from "./chunk-UEAX6KUB.js";
|
|
19
19
|
import {
|
|
20
20
|
requireAccount
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-GHT2DLZR.js";
|
|
22
22
|
import {
|
|
23
23
|
buildPreviewOutput
|
|
24
24
|
} from "./chunk-R3VLWLVV.js";
|
|
@@ -28,7 +28,7 @@ import {
|
|
|
28
28
|
renderSuccess,
|
|
29
29
|
renderUnexpectedError,
|
|
30
30
|
resolveEffectiveConfig
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-5KANHEBN.js";
|
|
32
32
|
import {
|
|
33
33
|
READ_SINGLE_FLAGS,
|
|
34
34
|
WRITE_FLAGS,
|
|
@@ -71,7 +71,7 @@ var MEMBER_PROVIDER_ID_RE = /^A[CDE][A-Za-z0-9_-]{4,}$/;
|
|
|
71
71
|
async function handleSdkError(err, outOpts, out) {
|
|
72
72
|
const { CurviateError } = await import("@curviate/sdk");
|
|
73
73
|
if (err instanceof CurviateError) {
|
|
74
|
-
const { getExitCode } = await import("./exit-codes-
|
|
74
|
+
const { getExitCode } = await import("./exit-codes-U5CHA6FT.js");
|
|
75
75
|
renderError(err, outOpts, out);
|
|
76
76
|
process.exit(getExitCode(err.code));
|
|
77
77
|
}
|
package/dist/cli.js
CHANGED
|
@@ -340,23 +340,23 @@ var main = defineCommand({
|
|
|
340
340
|
// ---------------------------------------------------------------------------
|
|
341
341
|
// Noun groups, lazy-loaded on first invocation.
|
|
342
342
|
// ---------------------------------------------------------------------------
|
|
343
|
-
profile: () => import("./profile-
|
|
344
|
-
company: () => import("./company-
|
|
345
|
-
job: () => import("./job-
|
|
346
|
-
connect: () => import("./connect-
|
|
347
|
-
search: () => import("./search-
|
|
348
|
-
inbox: () => import("./inbox-
|
|
349
|
-
inboxes: () => import("./inboxes-
|
|
350
|
-
message: () => import("./message-
|
|
351
|
-
post: () => import("./post-
|
|
352
|
-
comment: () => import("./comment-
|
|
353
|
-
account: () => import("./account-
|
|
354
|
-
webhook: () => import("./webhook-
|
|
355
|
-
"sales-nav": () => import("./sales-nav-
|
|
356
|
-
recruiter: () => import("./recruiter-
|
|
357
|
-
group: () => import("./group-
|
|
358
|
-
feed: () => import("./feed-
|
|
359
|
-
notification: () => import("./notification-
|
|
343
|
+
profile: () => import("./profile-72V55PZM.js").then((m) => m.profileCommand),
|
|
344
|
+
company: () => import("./company-ZT65QZ6F.js").then((m) => m.companyCommand),
|
|
345
|
+
job: () => import("./job-NUT4QMH2.js").then((m) => m.jobCommand),
|
|
346
|
+
connect: () => import("./connect-57AUN33D.js").then((m) => m.connectCommand),
|
|
347
|
+
search: () => import("./search-QCXTK33P.js").then((m) => m.searchCommand),
|
|
348
|
+
inbox: () => import("./inbox-CQO2I47N.js").then((m) => m.inboxCommand),
|
|
349
|
+
inboxes: () => import("./inboxes-XQ2B6X3Q.js").then((m) => m.inboxesCommand),
|
|
350
|
+
message: () => import("./message-KMNRUD4H.js").then((m) => m.messageCommand),
|
|
351
|
+
post: () => import("./post-FXAANNUB.js").then((m) => m.postCommand),
|
|
352
|
+
comment: () => import("./comment-BLG4WHST.js").then((m) => m.commentCommand),
|
|
353
|
+
account: () => import("./account-5KGM6EPR.js").then((m) => m.accountCommand),
|
|
354
|
+
webhook: () => import("./webhook-D4QRWF7W.js").then((m) => m.webhookCommand),
|
|
355
|
+
"sales-nav": () => import("./sales-nav-BALVVD35.js").then((m) => m.salesNavCommand),
|
|
356
|
+
recruiter: () => import("./recruiter-JUNB5AUR.js").then((m) => m.recruiterCommand),
|
|
357
|
+
group: () => import("./group-DYC2NX5M.js").then((m) => m.groupCommand),
|
|
358
|
+
feed: () => import("./feed-3AWI2URQ.js").then((m) => m.feedCommand),
|
|
359
|
+
notification: () => import("./notification-LEM57IBY.js").then((m) => m.notificationCommand)
|
|
360
360
|
},
|
|
361
361
|
async run() {
|
|
362
362
|
const { runMain } = await import("citty");
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
resolveMemberOrMeProviderId
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-6P52Q2GK.js";
|
|
5
5
|
import {
|
|
6
6
|
AttachError,
|
|
7
7
|
describeAttachment,
|
|
@@ -11,11 +11,11 @@ import {
|
|
|
11
11
|
import {
|
|
12
12
|
pageDelayFromFlags,
|
|
13
13
|
streamAll
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-63X3VI3T.js";
|
|
15
15
|
import "./chunk-UEAX6KUB.js";
|
|
16
16
|
import {
|
|
17
17
|
requireAccount
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-GHT2DLZR.js";
|
|
19
19
|
import {
|
|
20
20
|
buildPreviewOutput
|
|
21
21
|
} from "./chunk-R3VLWLVV.js";
|
|
@@ -25,14 +25,14 @@ import {
|
|
|
25
25
|
renderSuccess,
|
|
26
26
|
renderUnexpectedError,
|
|
27
27
|
resolveEffectiveConfig
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-5KANHEBN.js";
|
|
29
29
|
import "./chunk-KTY7R27U.js";
|
|
30
30
|
import {
|
|
31
31
|
GLOBAL_FLAGS,
|
|
32
32
|
WRITE_SINGLE_FLAGS,
|
|
33
33
|
resolveTextOrStdin
|
|
34
34
|
} from "./chunk-AHYUM2XQ.js";
|
|
35
|
-
import "./chunk-
|
|
35
|
+
import "./chunk-2OG6M6ME.js";
|
|
36
36
|
|
|
37
37
|
// src/commands/comment.ts
|
|
38
38
|
import { defineCommand } from "citty";
|
|
@@ -66,7 +66,7 @@ function buildListQuery(flags) {
|
|
|
66
66
|
async function handleSdkError(err, outOpts, out) {
|
|
67
67
|
const { CurviateError } = await import("@curviate/sdk");
|
|
68
68
|
if (err instanceof CurviateError) {
|
|
69
|
-
const { getExitCode } = await import("./exit-codes-
|
|
69
|
+
const { getExitCode } = await import("./exit-codes-U5CHA6FT.js");
|
|
70
70
|
renderError(err, outOpts, out);
|
|
71
71
|
process.exit(getExitCode(err.code));
|
|
72
72
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
sentAsNotice
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-TAOXJNQN.js";
|
|
5
5
|
import "./chunk-HOQ7EUHJ.js";
|
|
6
6
|
import {
|
|
7
7
|
AttachError,
|
|
@@ -20,14 +20,14 @@ import {
|
|
|
20
20
|
import {
|
|
21
21
|
pageDelayFromFlags,
|
|
22
22
|
streamAll
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-63X3VI3T.js";
|
|
24
24
|
import "./chunk-UWO2D4HW.js";
|
|
25
25
|
import {
|
|
26
26
|
resolveIdentifier
|
|
27
27
|
} from "./chunk-UEAX6KUB.js";
|
|
28
28
|
import {
|
|
29
29
|
requireAccount
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-GHT2DLZR.js";
|
|
31
31
|
import {
|
|
32
32
|
buildPreviewOutput
|
|
33
33
|
} from "./chunk-R3VLWLVV.js";
|
|
@@ -37,14 +37,14 @@ import {
|
|
|
37
37
|
renderSuccess,
|
|
38
38
|
renderUnexpectedError,
|
|
39
39
|
resolveEffectiveConfig
|
|
40
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-5KANHEBN.js";
|
|
41
41
|
import "./chunk-KTY7R27U.js";
|
|
42
42
|
import {
|
|
43
43
|
GLOBAL_FLAGS,
|
|
44
44
|
WRITE_FLAGS,
|
|
45
45
|
resolveTextOrStdin
|
|
46
46
|
} from "./chunk-AHYUM2XQ.js";
|
|
47
|
-
import "./chunk-
|
|
47
|
+
import "./chunk-2OG6M6ME.js";
|
|
48
48
|
|
|
49
49
|
// src/commands/company.ts
|
|
50
50
|
import { defineCommand } from "citty";
|
|
@@ -85,7 +85,7 @@ async function resolveCompanyId(ns, raw) {
|
|
|
85
85
|
async function handleSdkError(err, outOpts, out) {
|
|
86
86
|
const { CurviateError } = await import("@curviate/sdk");
|
|
87
87
|
if (err instanceof CurviateError) {
|
|
88
|
-
const { getExitCode } = await import("./exit-codes-
|
|
88
|
+
const { getExitCode } = await import("./exit-codes-U5CHA6FT.js");
|
|
89
89
|
renderError(err, outOpts, out);
|
|
90
90
|
process.exit(getExitCode(err.code));
|
|
91
91
|
}
|
|
@@ -11,13 +11,13 @@ import {
|
|
|
11
11
|
import {
|
|
12
12
|
pageDelayFromFlags,
|
|
13
13
|
streamAll
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-63X3VI3T.js";
|
|
15
15
|
import {
|
|
16
16
|
resolveIdentifier
|
|
17
17
|
} from "./chunk-UEAX6KUB.js";
|
|
18
18
|
import {
|
|
19
19
|
requireAccount
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-GHT2DLZR.js";
|
|
21
21
|
import {
|
|
22
22
|
buildPreviewOutput
|
|
23
23
|
} from "./chunk-R3VLWLVV.js";
|
|
@@ -27,13 +27,13 @@ import {
|
|
|
27
27
|
renderSuccess,
|
|
28
28
|
renderUnexpectedError,
|
|
29
29
|
resolveEffectiveConfig
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-5KANHEBN.js";
|
|
31
31
|
import "./chunk-KTY7R27U.js";
|
|
32
32
|
import {
|
|
33
33
|
GLOBAL_FLAGS,
|
|
34
34
|
WRITE_FLAGS
|
|
35
35
|
} from "./chunk-AHYUM2XQ.js";
|
|
36
|
-
import "./chunk-
|
|
36
|
+
import "./chunk-2OG6M6ME.js";
|
|
37
37
|
|
|
38
38
|
// src/commands/connect.ts
|
|
39
39
|
import { defineCommand } from "citty";
|
|
@@ -83,7 +83,7 @@ async function runConnectSend(client, flags, out) {
|
|
|
83
83
|
} catch (err) {
|
|
84
84
|
const { CurviateError } = await import("@curviate/sdk");
|
|
85
85
|
if (err instanceof CurviateError) {
|
|
86
|
-
const { getExitCode } = await import("./exit-codes-
|
|
86
|
+
const { getExitCode } = await import("./exit-codes-U5CHA6FT.js");
|
|
87
87
|
renderError(err, outOpts, out);
|
|
88
88
|
process.exit(getExitCode(err.code));
|
|
89
89
|
}
|
|
@@ -121,7 +121,7 @@ async function runConnectSent(client, flags, out) {
|
|
|
121
121
|
} catch (err) {
|
|
122
122
|
const { CurviateError } = await import("@curviate/sdk");
|
|
123
123
|
if (err instanceof CurviateError) {
|
|
124
|
-
const { getExitCode } = await import("./exit-codes-
|
|
124
|
+
const { getExitCode } = await import("./exit-codes-U5CHA6FT.js");
|
|
125
125
|
renderError(err, outOpts, out);
|
|
126
126
|
process.exit(getExitCode(err.code));
|
|
127
127
|
}
|
|
@@ -159,7 +159,7 @@ async function runConnectReceived(client, flags, out) {
|
|
|
159
159
|
} catch (err) {
|
|
160
160
|
const { CurviateError } = await import("@curviate/sdk");
|
|
161
161
|
if (err instanceof CurviateError) {
|
|
162
|
-
const { getExitCode } = await import("./exit-codes-
|
|
162
|
+
const { getExitCode } = await import("./exit-codes-U5CHA6FT.js");
|
|
163
163
|
renderError(err, outOpts, out);
|
|
164
164
|
process.exit(getExitCode(err.code));
|
|
165
165
|
}
|
|
@@ -188,7 +188,7 @@ async function runConnectAccept(client, flags, out) {
|
|
|
188
188
|
} catch (err) {
|
|
189
189
|
const { CurviateError } = await import("@curviate/sdk");
|
|
190
190
|
if (err instanceof CurviateError) {
|
|
191
|
-
const { getExitCode } = await import("./exit-codes-
|
|
191
|
+
const { getExitCode } = await import("./exit-codes-U5CHA6FT.js");
|
|
192
192
|
renderError(err, outOpts, out);
|
|
193
193
|
process.exit(getExitCode(err.code));
|
|
194
194
|
}
|
|
@@ -217,7 +217,7 @@ async function runConnectDecline(client, flags, out) {
|
|
|
217
217
|
} catch (err) {
|
|
218
218
|
const { CurviateError } = await import("@curviate/sdk");
|
|
219
219
|
if (err instanceof CurviateError) {
|
|
220
|
-
const { getExitCode } = await import("./exit-codes-
|
|
220
|
+
const { getExitCode } = await import("./exit-codes-U5CHA6FT.js");
|
|
221
221
|
renderError(err, outOpts, out);
|
|
222
222
|
process.exit(getExitCode(err.code));
|
|
223
223
|
}
|
|
@@ -246,7 +246,7 @@ async function runConnectCancel(client, flags, out) {
|
|
|
246
246
|
} catch (err) {
|
|
247
247
|
const { CurviateError } = await import("@curviate/sdk");
|
|
248
248
|
if (err instanceof CurviateError) {
|
|
249
|
-
const { getExitCode } = await import("./exit-codes-
|
|
249
|
+
const { getExitCode } = await import("./exit-codes-U5CHA6FT.js");
|
|
250
250
|
renderError(err, outOpts, out);
|
|
251
251
|
process.exit(getExitCode(err.code));
|
|
252
252
|
}
|