@curviate/cli 0.32.0 → 0.34.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 +264 -1
- package/README.md +13 -1
- package/dist/{account-JDSZC633.js → account-463D5EVY.js} +90 -47
- package/dist/{chunk-JRKM4OV2.js → chunk-6W7364S3.js} +1 -1
- package/dist/{chunk-KQXYEQAD.js → chunk-7JU4IXXG.js} +172 -8
- package/dist/{chunk-5EJDQ47B.js → chunk-BN7L7WSY.js} +16 -16
- package/dist/chunk-DCZR4M7G.js +327 -0
- package/dist/{chunk-V3PB4HSF.js → chunk-MNDXMGPX.js} +68 -24
- package/dist/chunk-TCUYH5GO.js +34 -0
- package/dist/{chunk-SKJNLN37.js → chunk-XDQHNUEU.js} +86 -2
- package/dist/{chunk-LJR4LJG6.js → chunk-XP2LN6F6.js} +53 -0
- package/dist/{chunk-EIEF2KFH.js → chunk-XZJQQJBE.js} +6 -4
- package/dist/{chunk-6P52Q2GK.js → chunk-ZJ7D3NFS.js} +5 -4
- package/dist/cli.js +104 -37
- package/dist/{comment-YOFNFQUE.js → comment-G6RB2PBZ.js} +32 -26
- package/dist/{company-6PKHDK6L.js → company-OWND3W3L.js} +53 -35
- package/dist/{config-FUHT23SX.js → config-RUBXWFQ3.js} +74 -29
- package/dist/{connect-DG2AVGVL.js → connect-3E7EC5ZM.js} +35 -32
- package/dist/{doctor-FK7B6754.js → doctor-Z6OSCGKT.js} +22 -16
- package/dist/{exit-codes-AAFTOAXF.js → exit-codes-YSFFFWMS.js} +1 -1
- package/dist/{feed-HXBKXKAQ.js → feed-VDTFIMKN.js} +18 -17
- package/dist/{group-UYX3KTX3.js → group-KDJHY2IM.js} +21 -18
- package/dist/{inbox-EVE2ZTHC.js → inbox-DQLX2LR7.js} +39 -23
- package/dist/{inboxes-JBB34WMQ.js → inboxes-WMNHOPY7.js} +18 -17
- package/dist/{job-GXUZANYN.js → job-ESKS2LDJ.js} +44 -30
- package/dist/{login-3OAUY7TG.js → login-YTVPIN27.js} +15 -3
- package/dist/{message-34AGROW2.js → message-5W2R3YHS.js} +7 -9
- package/dist/{notification-SKKZS2C5.js → notification-IGNUH2GR.js} +20 -19
- package/dist/{post-FIW522Q6.js → post-NLI76K74.js} +34 -26
- package/dist/{profile-SX6JOYMD.js → profile-TBKKIICM.js} +71 -90
- package/dist/{recruiter-H7ROBEVC.js → recruiter-AEJRHIX5.js} +42 -29
- package/dist/{sales-nav-7KCK562X.js → sales-nav-SW6WJVMD.js} +43 -29
- package/dist/{search-PASMDQEH.js → search-CS6VN5AG.js} +58 -44
- package/dist/{setup-YV5PVIU5.js → setup-ANHJZJ2S.js} +12 -8
- package/dist/{webhook-GPLFPC6N.js → webhook-NGMRJMQ5.js} +25 -22
- package/package.json +2 -2
- package/dist/chunk-LKF5MZIP.js +0 -90
- package/dist/chunk-PKSKQ3LN.js +0 -68
- package/dist/chunk-R3VLWLVV.js +0 -23
- package/dist/chunk-TD2ZIXFR.js +0 -67
- package/dist/chunk-TQJ77SL4.js +0 -147
|
@@ -4,39 +4,38 @@ import {
|
|
|
4
4
|
slimInviteReceivedItem,
|
|
5
5
|
slimInviteSent,
|
|
6
6
|
slimInviteSentItem
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import {
|
|
9
|
-
pageDelayFromFlags,
|
|
10
|
-
streamAll
|
|
11
|
-
} from "./chunk-LKF5MZIP.js";
|
|
7
|
+
} from "./chunk-XP2LN6F6.js";
|
|
12
8
|
import {
|
|
13
9
|
nearestSubcommand
|
|
14
10
|
} from "./chunk-HOQ7EUHJ.js";
|
|
15
11
|
import {
|
|
16
12
|
resolveIdentifier
|
|
17
13
|
} from "./chunk-UEAX6KUB.js";
|
|
18
|
-
import {
|
|
19
|
-
buildPreviewOutput
|
|
20
|
-
} from "./chunk-R3VLWLVV.js";
|
|
21
14
|
import {
|
|
22
15
|
requireAccount
|
|
23
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-MNDXMGPX.js";
|
|
24
17
|
import {
|
|
18
|
+
buildPreviewOutput
|
|
19
|
+
} from "./chunk-TCUYH5GO.js";
|
|
20
|
+
import {
|
|
21
|
+
pageDelayFromFlags,
|
|
22
|
+
readablePage,
|
|
23
|
+
rejectPaginationModifiersWithoutAll,
|
|
25
24
|
renderError,
|
|
26
25
|
renderSuccess,
|
|
27
|
-
renderUnexpectedError
|
|
28
|
-
|
|
26
|
+
renderUnexpectedError,
|
|
27
|
+
resolveEffectiveConfig,
|
|
28
|
+
streamAll,
|
|
29
|
+
writeNdjsonItem
|
|
30
|
+
} from "./chunk-7JU4IXXG.js";
|
|
31
|
+
import "./chunk-XZJQQJBE.js";
|
|
29
32
|
import {
|
|
30
|
-
createClient
|
|
31
|
-
|
|
32
|
-
} from "./chunk-TD2ZIXFR.js";
|
|
33
|
-
import "./chunk-PKSKQ3LN.js";
|
|
34
|
-
import "./chunk-EIEF2KFH.js";
|
|
35
|
-
import "./chunk-TQJ77SL4.js";
|
|
33
|
+
createClient
|
|
34
|
+
} from "./chunk-DCZR4M7G.js";
|
|
36
35
|
import {
|
|
37
36
|
GLOBAL_FLAGS,
|
|
38
37
|
WRITE_FLAGS
|
|
39
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-XDQHNUEU.js";
|
|
40
39
|
|
|
41
40
|
// src/commands/connect.ts
|
|
42
41
|
import { defineCommand } from "citty";
|
|
@@ -86,9 +85,9 @@ async function runConnectSend(client, flags, out) {
|
|
|
86
85
|
} catch (err) {
|
|
87
86
|
const { CurviateError } = await import("@curviate/sdk");
|
|
88
87
|
if (err instanceof CurviateError) {
|
|
89
|
-
const { getExitCode } = await import("./exit-codes-
|
|
88
|
+
const { getExitCode } = await import("./exit-codes-YSFFFWMS.js");
|
|
90
89
|
renderError(err, outOpts, out);
|
|
91
|
-
process.exit(getExitCode(err
|
|
90
|
+
process.exit(getExitCode(err));
|
|
92
91
|
}
|
|
93
92
|
renderUnexpectedError(err, out);
|
|
94
93
|
process.exit(1);
|
|
@@ -96,6 +95,7 @@ async function runConnectSend(client, flags, out) {
|
|
|
96
95
|
}
|
|
97
96
|
async function runConnectSent(client, flags, out) {
|
|
98
97
|
rejectPreviewOnRead(flags.preview, out);
|
|
98
|
+
rejectPaginationModifiersWithoutAll(flags, out);
|
|
99
99
|
const accountId = await requireAccount(client, flags, out);
|
|
100
100
|
const ns = client.account(accountId);
|
|
101
101
|
const outOpts = resolveOutputOpts(flags);
|
|
@@ -115,18 +115,19 @@ async function runConnectSent(client, flags, out) {
|
|
|
115
115
|
pageDelayMs: pageDelayFromFlags(flags)
|
|
116
116
|
})) {
|
|
117
117
|
const projected = !flags.verbose ? slimInviteSentItem(item) : item;
|
|
118
|
-
out
|
|
118
|
+
writeNdjsonItem(out, projected, outOpts.fields, item);
|
|
119
119
|
}
|
|
120
120
|
} else {
|
|
121
121
|
const result = await ns.invites.listSent(params);
|
|
122
|
+
readablePage(result);
|
|
122
123
|
renderSuccess(result, { ...outOpts, slim: slimInviteSent }, out);
|
|
123
124
|
}
|
|
124
125
|
} catch (err) {
|
|
125
126
|
const { CurviateError } = await import("@curviate/sdk");
|
|
126
127
|
if (err instanceof CurviateError) {
|
|
127
|
-
const { getExitCode } = await import("./exit-codes-
|
|
128
|
+
const { getExitCode } = await import("./exit-codes-YSFFFWMS.js");
|
|
128
129
|
renderError(err, outOpts, out);
|
|
129
|
-
process.exit(getExitCode(err
|
|
130
|
+
process.exit(getExitCode(err));
|
|
130
131
|
}
|
|
131
132
|
renderUnexpectedError(err, out);
|
|
132
133
|
process.exit(1);
|
|
@@ -134,6 +135,7 @@ async function runConnectSent(client, flags, out) {
|
|
|
134
135
|
}
|
|
135
136
|
async function runConnectReceived(client, flags, out) {
|
|
136
137
|
rejectPreviewOnRead(flags.preview, out);
|
|
138
|
+
rejectPaginationModifiersWithoutAll(flags, out);
|
|
137
139
|
const accountId = await requireAccount(client, flags, out);
|
|
138
140
|
const ns = client.account(accountId);
|
|
139
141
|
const outOpts = resolveOutputOpts(flags);
|
|
@@ -153,18 +155,19 @@ async function runConnectReceived(client, flags, out) {
|
|
|
153
155
|
pageDelayMs: pageDelayFromFlags(flags)
|
|
154
156
|
})) {
|
|
155
157
|
const projected = !flags.verbose ? slimInviteReceivedItem(item) : item;
|
|
156
|
-
out
|
|
158
|
+
writeNdjsonItem(out, projected, outOpts.fields, item);
|
|
157
159
|
}
|
|
158
160
|
} else {
|
|
159
161
|
const result = await ns.invites.listReceived(params);
|
|
162
|
+
readablePage(result);
|
|
160
163
|
renderSuccess(result, { ...outOpts, slim: slimInviteReceived }, out);
|
|
161
164
|
}
|
|
162
165
|
} catch (err) {
|
|
163
166
|
const { CurviateError } = await import("@curviate/sdk");
|
|
164
167
|
if (err instanceof CurviateError) {
|
|
165
|
-
const { getExitCode } = await import("./exit-codes-
|
|
168
|
+
const { getExitCode } = await import("./exit-codes-YSFFFWMS.js");
|
|
166
169
|
renderError(err, outOpts, out);
|
|
167
|
-
process.exit(getExitCode(err
|
|
170
|
+
process.exit(getExitCode(err));
|
|
168
171
|
}
|
|
169
172
|
renderUnexpectedError(err, out);
|
|
170
173
|
process.exit(1);
|
|
@@ -191,9 +194,9 @@ async function runConnectAccept(client, flags, out) {
|
|
|
191
194
|
} catch (err) {
|
|
192
195
|
const { CurviateError } = await import("@curviate/sdk");
|
|
193
196
|
if (err instanceof CurviateError) {
|
|
194
|
-
const { getExitCode } = await import("./exit-codes-
|
|
197
|
+
const { getExitCode } = await import("./exit-codes-YSFFFWMS.js");
|
|
195
198
|
renderError(err, outOpts, out);
|
|
196
|
-
process.exit(getExitCode(err
|
|
199
|
+
process.exit(getExitCode(err));
|
|
197
200
|
}
|
|
198
201
|
renderUnexpectedError(err, out);
|
|
199
202
|
process.exit(1);
|
|
@@ -220,9 +223,9 @@ async function runConnectDecline(client, flags, out) {
|
|
|
220
223
|
} catch (err) {
|
|
221
224
|
const { CurviateError } = await import("@curviate/sdk");
|
|
222
225
|
if (err instanceof CurviateError) {
|
|
223
|
-
const { getExitCode } = await import("./exit-codes-
|
|
226
|
+
const { getExitCode } = await import("./exit-codes-YSFFFWMS.js");
|
|
224
227
|
renderError(err, outOpts, out);
|
|
225
|
-
process.exit(getExitCode(err
|
|
228
|
+
process.exit(getExitCode(err));
|
|
226
229
|
}
|
|
227
230
|
renderUnexpectedError(err, out);
|
|
228
231
|
process.exit(1);
|
|
@@ -249,9 +252,9 @@ async function runConnectCancel(client, flags, out) {
|
|
|
249
252
|
} catch (err) {
|
|
250
253
|
const { CurviateError } = await import("@curviate/sdk");
|
|
251
254
|
if (err instanceof CurviateError) {
|
|
252
|
-
const { getExitCode } = await import("./exit-codes-
|
|
255
|
+
const { getExitCode } = await import("./exit-codes-YSFFFWMS.js");
|
|
253
256
|
renderError(err, outOpts, out);
|
|
254
|
-
process.exit(getExitCode(err
|
|
257
|
+
process.exit(getExitCode(err));
|
|
255
258
|
}
|
|
256
259
|
renderUnexpectedError(err, out);
|
|
257
260
|
process.exit(1);
|
|
@@ -1,19 +1,21 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
|
-
|
|
3
|
+
readablePage,
|
|
4
4
|
resolveEffectiveConfig
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-PKSKQ3LN.js";
|
|
5
|
+
} from "./chunk-7JU4IXXG.js";
|
|
7
6
|
import {
|
|
8
7
|
getExitCode
|
|
9
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-XZJQQJBE.js";
|
|
10
9
|
import {
|
|
10
|
+
createClient,
|
|
11
11
|
getConfigPath,
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
isPlainObject,
|
|
13
|
+
readConfigFile,
|
|
14
|
+
withoutUserinfo
|
|
15
|
+
} from "./chunk-DCZR4M7G.js";
|
|
14
16
|
import {
|
|
15
17
|
GLOBAL_FLAGS
|
|
16
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-XDQHNUEU.js";
|
|
17
19
|
|
|
18
20
|
// src/commands/doctor.ts
|
|
19
21
|
import { defineCommand } from "citty";
|
|
@@ -57,15 +59,18 @@ function accountLines(payload) {
|
|
|
57
59
|
});
|
|
58
60
|
}
|
|
59
61
|
async function runDoctor(args, io) {
|
|
60
|
-
const
|
|
62
|
+
const file = await readConfigFile();
|
|
61
63
|
const effective = await resolveEffectiveConfig({
|
|
62
64
|
apiKey: args["api-key"],
|
|
63
65
|
baseUrl: args["base-url"],
|
|
64
66
|
timeout: args.timeout,
|
|
65
67
|
profile: args.profile
|
|
66
68
|
});
|
|
67
|
-
const
|
|
69
|
+
const root = file?.root;
|
|
70
|
+
const active = isPlainObject(root) && typeof root["active"] === "string" ? root["active"] : void 0;
|
|
71
|
+
const profileName = args.profile ?? active ?? "default";
|
|
68
72
|
const checks = [];
|
|
73
|
+
const shownBaseUrl = withoutUserinfo(effective.baseUrl);
|
|
69
74
|
const credentialResolved = effective.apiKey !== void 0;
|
|
70
75
|
checks.push({
|
|
71
76
|
name: "credential",
|
|
@@ -85,14 +90,15 @@ async function runDoctor(args, io) {
|
|
|
85
90
|
effective.baseUrl,
|
|
86
91
|
effective.timeout
|
|
87
92
|
);
|
|
93
|
+
readablePage(payload);
|
|
88
94
|
reachable = true;
|
|
89
95
|
valid = true;
|
|
90
96
|
accounts = accountLines(payload);
|
|
91
|
-
checks.push({ name: "api reachable", ok: true, detail:
|
|
97
|
+
checks.push({ name: "api reachable", ok: true, detail: shownBaseUrl, exit: 7 });
|
|
92
98
|
checks.push({
|
|
93
99
|
name: "credential valid",
|
|
94
100
|
ok: true,
|
|
95
|
-
detail: `accepted by ${
|
|
101
|
+
detail: `accepted by ${shownBaseUrl}`,
|
|
96
102
|
exit: 3
|
|
97
103
|
});
|
|
98
104
|
checks.push({
|
|
@@ -106,12 +112,12 @@ async function runDoctor(args, io) {
|
|
|
106
112
|
const code = typeof error.code === "string" ? error.code : void 0;
|
|
107
113
|
const responded = typeof error.httpStatus === "number";
|
|
108
114
|
const transportFault = !responded && error.retryLikelyToSucceed === true;
|
|
109
|
-
const codeExit = code ? getExitCode(
|
|
115
|
+
const codeExit = code ? getExitCode(error) : 3;
|
|
110
116
|
reachable = responded;
|
|
111
117
|
checks.push({
|
|
112
118
|
name: "api reachable",
|
|
113
119
|
ok: reachable,
|
|
114
|
-
detail: reachable ?
|
|
120
|
+
detail: reachable ? shownBaseUrl : transportFault ? `could not reach ${shownBaseUrl}: ${error.message ?? "network error"}` : "not checked: the request was refused before it was sent",
|
|
115
121
|
exit: transportFault ? 7 : codeExit
|
|
116
122
|
});
|
|
117
123
|
checks.push({
|
|
@@ -120,18 +126,18 @@ async function runDoctor(args, io) {
|
|
|
120
126
|
// Nothing asked the credential anything unless a response came back,
|
|
121
127
|
// so it was not "rejected". Saying it was is the half of this defect
|
|
122
128
|
// that actually misdirects: it names the one subsystem that is fine.
|
|
123
|
-
detail: responded ? code ? `rejected: ${code}` : error.message ?? "the call did not succeed" : transportFault ? `not checked: ${
|
|
129
|
+
detail: responded ? code === "PLATFORM_ERROR" ? `not verified: ${error.message ?? code}` : code ? `rejected: ${code}` : error.message ?? "the call did not succeed" : transportFault ? `not checked: ${shownBaseUrl} could not be reached` : error.message ?? "the request was refused before it was sent",
|
|
124
130
|
exit: responded ? codeExit : transportFault ? 3 : codeExit
|
|
125
131
|
});
|
|
126
132
|
}
|
|
127
133
|
}
|
|
128
|
-
const tenant = effective.
|
|
134
|
+
const tenant = effective.tenant ?? null;
|
|
129
135
|
const firstFailure = checks.find((c) => !c.ok);
|
|
130
136
|
const report = {
|
|
131
137
|
version: io.version(),
|
|
132
138
|
config_path: getConfigPath(),
|
|
133
139
|
profile: profileName,
|
|
134
|
-
base_url:
|
|
140
|
+
base_url: shownBaseUrl,
|
|
135
141
|
credential_source: effective.apiKeySource,
|
|
136
142
|
credential_resolved: credentialResolved,
|
|
137
143
|
tenant,
|
|
@@ -1,26 +1,25 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
pageDelayFromFlags,
|
|
4
|
-
streamAll
|
|
5
|
-
} from "./chunk-LKF5MZIP.js";
|
|
6
2
|
import {
|
|
7
3
|
requireAccount
|
|
8
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-MNDXMGPX.js";
|
|
9
5
|
import {
|
|
6
|
+
pageDelayFromFlags,
|
|
7
|
+
readablePage,
|
|
8
|
+
rejectPaginationModifiersWithoutAll,
|
|
10
9
|
renderError,
|
|
11
10
|
renderSuccess,
|
|
12
|
-
renderUnexpectedError
|
|
13
|
-
|
|
11
|
+
renderUnexpectedError,
|
|
12
|
+
resolveEffectiveConfig,
|
|
13
|
+
streamAll,
|
|
14
|
+
writeNdjsonItem
|
|
15
|
+
} from "./chunk-7JU4IXXG.js";
|
|
16
|
+
import "./chunk-XZJQQJBE.js";
|
|
14
17
|
import {
|
|
15
|
-
createClient
|
|
16
|
-
|
|
17
|
-
} from "./chunk-TD2ZIXFR.js";
|
|
18
|
-
import "./chunk-PKSKQ3LN.js";
|
|
19
|
-
import "./chunk-EIEF2KFH.js";
|
|
20
|
-
import "./chunk-TQJ77SL4.js";
|
|
18
|
+
createClient
|
|
19
|
+
} from "./chunk-DCZR4M7G.js";
|
|
21
20
|
import {
|
|
22
21
|
GLOBAL_FLAGS
|
|
23
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-XDQHNUEU.js";
|
|
24
23
|
|
|
25
24
|
// src/commands/feed.ts
|
|
26
25
|
import { defineCommand } from "citty";
|
|
@@ -47,15 +46,16 @@ function resolveOutputOpts(flags) {
|
|
|
47
46
|
async function handleSdkError(err, outOpts, out) {
|
|
48
47
|
const { CurviateError } = await import("@curviate/sdk");
|
|
49
48
|
if (err instanceof CurviateError) {
|
|
50
|
-
const { getExitCode } = await import("./exit-codes-
|
|
49
|
+
const { getExitCode } = await import("./exit-codes-YSFFFWMS.js");
|
|
51
50
|
renderError(err, outOpts, out);
|
|
52
|
-
process.exit(getExitCode(err
|
|
51
|
+
process.exit(getExitCode(err));
|
|
53
52
|
}
|
|
54
53
|
renderUnexpectedError(err, out);
|
|
55
54
|
process.exit(1);
|
|
56
55
|
}
|
|
57
56
|
async function runFeedHome(client, flags, out) {
|
|
58
57
|
rejectPreviewOnRead(flags.preview, out);
|
|
58
|
+
rejectPaginationModifiersWithoutAll(flags, out);
|
|
59
59
|
const accountId = await requireAccount(client, flags, out);
|
|
60
60
|
const ns = client.account(accountId);
|
|
61
61
|
const outOpts = resolveOutputOpts(flags);
|
|
@@ -73,10 +73,11 @@ async function runFeedHome(client, flags, out) {
|
|
|
73
73
|
out,
|
|
74
74
|
pageDelayMs: pageDelayFromFlags(flags)
|
|
75
75
|
})) {
|
|
76
|
-
out
|
|
76
|
+
writeNdjsonItem(out, item, outOpts.fields);
|
|
77
77
|
}
|
|
78
78
|
} else {
|
|
79
79
|
const result = await ns.feed.home(params);
|
|
80
|
+
readablePage(result);
|
|
80
81
|
renderSuccess(result, outOpts, out);
|
|
81
82
|
}
|
|
82
83
|
} catch (err) {
|
|
@@ -1,30 +1,29 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
pageDelayFromFlags,
|
|
4
|
-
streamAll
|
|
5
|
-
} from "./chunk-LKF5MZIP.js";
|
|
6
2
|
import {
|
|
7
3
|
normalizeGroupId
|
|
8
4
|
} from "./chunk-UEAX6KUB.js";
|
|
9
5
|
import {
|
|
10
6
|
requireAccount
|
|
11
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-MNDXMGPX.js";
|
|
12
8
|
import {
|
|
9
|
+
pageDelayFromFlags,
|
|
10
|
+
readablePage,
|
|
11
|
+
rejectPaginationModifiersWithoutAll,
|
|
13
12
|
renderError,
|
|
14
13
|
renderSuccess,
|
|
15
|
-
renderUnexpectedError
|
|
16
|
-
|
|
14
|
+
renderUnexpectedError,
|
|
15
|
+
resolveEffectiveConfig,
|
|
16
|
+
streamAll,
|
|
17
|
+
writeNdjsonItem
|
|
18
|
+
} from "./chunk-7JU4IXXG.js";
|
|
19
|
+
import "./chunk-XZJQQJBE.js";
|
|
17
20
|
import {
|
|
18
|
-
createClient
|
|
19
|
-
|
|
20
|
-
} from "./chunk-TD2ZIXFR.js";
|
|
21
|
-
import "./chunk-PKSKQ3LN.js";
|
|
22
|
-
import "./chunk-EIEF2KFH.js";
|
|
23
|
-
import "./chunk-TQJ77SL4.js";
|
|
21
|
+
createClient
|
|
22
|
+
} from "./chunk-DCZR4M7G.js";
|
|
24
23
|
import {
|
|
25
24
|
GLOBAL_FLAGS,
|
|
26
25
|
READ_SINGLE_FLAGS
|
|
27
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-XDQHNUEU.js";
|
|
28
27
|
|
|
29
28
|
// src/commands/group.ts
|
|
30
29
|
import { defineCommand } from "citty";
|
|
@@ -57,15 +56,16 @@ function resolveOutputOpts(flags) {
|
|
|
57
56
|
async function handleSdkError(err, outOpts, out) {
|
|
58
57
|
const { CurviateError } = await import("@curviate/sdk");
|
|
59
58
|
if (err instanceof CurviateError) {
|
|
60
|
-
const { getExitCode } = await import("./exit-codes-
|
|
59
|
+
const { getExitCode } = await import("./exit-codes-YSFFFWMS.js");
|
|
61
60
|
renderError(err, outOpts, out);
|
|
62
|
-
process.exit(getExitCode(err
|
|
61
|
+
process.exit(getExitCode(err));
|
|
63
62
|
}
|
|
64
63
|
renderUnexpectedError(err, out);
|
|
65
64
|
process.exit(1);
|
|
66
65
|
}
|
|
67
66
|
async function runGroupList(client, flags, out) {
|
|
68
67
|
rejectPreviewOnRead(flags.preview, out);
|
|
68
|
+
rejectPaginationModifiersWithoutAll(flags, out);
|
|
69
69
|
const accountId = await requireAccount(client, flags, out);
|
|
70
70
|
const ns = client.account(accountId);
|
|
71
71
|
const outOpts = resolveOutputOpts(flags);
|
|
@@ -83,10 +83,11 @@ async function runGroupList(client, flags, out) {
|
|
|
83
83
|
out,
|
|
84
84
|
pageDelayMs: pageDelayFromFlags(flags)
|
|
85
85
|
})) {
|
|
86
|
-
out
|
|
86
|
+
writeNdjsonItem(out, item, outOpts.fields);
|
|
87
87
|
}
|
|
88
88
|
} else {
|
|
89
89
|
const result = await ns.groups.list(params);
|
|
90
|
+
readablePage(result);
|
|
90
91
|
renderSuccess(result, outOpts, out);
|
|
91
92
|
}
|
|
92
93
|
} catch (err) {
|
|
@@ -109,6 +110,7 @@ async function runGroupGet(client, flags, out) {
|
|
|
109
110
|
}
|
|
110
111
|
async function runGroupMembers(client, flags, out) {
|
|
111
112
|
rejectPreviewOnRead(flags.preview, out);
|
|
113
|
+
rejectPaginationModifiersWithoutAll(flags, out);
|
|
112
114
|
const accountId = await requireAccount(client, flags, out);
|
|
113
115
|
const groupId = normalizeGroupId(flags.groupId ?? "");
|
|
114
116
|
const ns = client.account(accountId);
|
|
@@ -127,10 +129,11 @@ async function runGroupMembers(client, flags, out) {
|
|
|
127
129
|
out,
|
|
128
130
|
pageDelayMs: pageDelayFromFlags(flags)
|
|
129
131
|
})) {
|
|
130
|
-
out
|
|
132
|
+
writeNdjsonItem(out, item, outOpts.fields);
|
|
131
133
|
}
|
|
132
134
|
} else {
|
|
133
135
|
const result = await ns.groups.members(groupId, params);
|
|
136
|
+
readablePage(result);
|
|
134
137
|
renderSuccess(result, outOpts, out);
|
|
135
138
|
}
|
|
136
139
|
} catch (err) {
|
|
@@ -3,36 +3,35 @@ import {
|
|
|
3
3
|
RETRIEVAL_FLAGS,
|
|
4
4
|
parseRetrievalFlags
|
|
5
5
|
} from "./chunk-PQWDDSV7.js";
|
|
6
|
-
import {
|
|
7
|
-
pageDelayFromFlags,
|
|
8
|
-
streamAll
|
|
9
|
-
} from "./chunk-LKF5MZIP.js";
|
|
10
6
|
import {
|
|
11
7
|
normalizeChatId
|
|
12
8
|
} from "./chunk-UEAX6KUB.js";
|
|
13
|
-
import {
|
|
14
|
-
buildPreviewOutput
|
|
15
|
-
} from "./chunk-R3VLWLVV.js";
|
|
16
9
|
import {
|
|
17
10
|
requireAccount
|
|
18
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-MNDXMGPX.js";
|
|
19
12
|
import {
|
|
13
|
+
buildPreviewOutput
|
|
14
|
+
} from "./chunk-TCUYH5GO.js";
|
|
15
|
+
import {
|
|
16
|
+
pageDelayFromFlags,
|
|
17
|
+
readablePage,
|
|
18
|
+
rejectPaginationModifiersWithoutAll,
|
|
20
19
|
renderError,
|
|
21
20
|
renderSuccess,
|
|
22
|
-
renderUnexpectedError
|
|
23
|
-
|
|
21
|
+
renderUnexpectedError,
|
|
22
|
+
resolveEffectiveConfig,
|
|
23
|
+
streamAll,
|
|
24
|
+
writeNdjsonItem
|
|
25
|
+
} from "./chunk-7JU4IXXG.js";
|
|
26
|
+
import "./chunk-XZJQQJBE.js";
|
|
24
27
|
import {
|
|
25
|
-
createClient
|
|
26
|
-
|
|
27
|
-
} from "./chunk-TD2ZIXFR.js";
|
|
28
|
-
import "./chunk-PKSKQ3LN.js";
|
|
29
|
-
import "./chunk-EIEF2KFH.js";
|
|
30
|
-
import "./chunk-TQJ77SL4.js";
|
|
28
|
+
createClient
|
|
29
|
+
} from "./chunk-DCZR4M7G.js";
|
|
31
30
|
import {
|
|
32
31
|
GLOBAL_FLAGS,
|
|
33
32
|
READ_SINGLE_FLAGS,
|
|
34
33
|
WRITE_SINGLE_FLAGS
|
|
35
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-XDQHNUEU.js";
|
|
36
35
|
|
|
37
36
|
// src/commands/inbox.ts
|
|
38
37
|
import { defineCommand } from "citty";
|
|
@@ -99,15 +98,16 @@ function validateInboxFolder(raw, out) {
|
|
|
99
98
|
async function handleSdkError(err, outOpts, out) {
|
|
100
99
|
const { CurviateError } = await import("@curviate/sdk");
|
|
101
100
|
if (err instanceof CurviateError) {
|
|
102
|
-
const { getExitCode } = await import("./exit-codes-
|
|
101
|
+
const { getExitCode } = await import("./exit-codes-YSFFFWMS.js");
|
|
103
102
|
renderError(err, outOpts, out);
|
|
104
|
-
process.exit(getExitCode(err
|
|
103
|
+
process.exit(getExitCode(err));
|
|
105
104
|
}
|
|
106
105
|
renderUnexpectedError(err, out);
|
|
107
106
|
process.exit(1);
|
|
108
107
|
}
|
|
109
108
|
async function runInboxList(client, flags, out) {
|
|
110
109
|
rejectPreviewOnRead(flags.preview, out);
|
|
110
|
+
rejectPaginationModifiersWithoutAll(flags, out);
|
|
111
111
|
const accountId = await requireAccount(client, flags, out);
|
|
112
112
|
const ns = client.account(accountId);
|
|
113
113
|
const outOpts = resolveOutputOpts(flags);
|
|
@@ -130,10 +130,11 @@ async function runInboxList(client, flags, out) {
|
|
|
130
130
|
out,
|
|
131
131
|
pageDelayMs: pageDelayFromFlags(flags)
|
|
132
132
|
})) {
|
|
133
|
-
out
|
|
133
|
+
writeNdjsonItem(out, item, outOpts.fields);
|
|
134
134
|
}
|
|
135
135
|
} else {
|
|
136
136
|
const result = await ns.messaging.listChats(params);
|
|
137
|
+
readablePage(result);
|
|
137
138
|
renderSuccess(result, outOpts, out);
|
|
138
139
|
}
|
|
139
140
|
} catch (err) {
|
|
@@ -180,6 +181,7 @@ async function runInboxMarkRead(client, flags, out) {
|
|
|
180
181
|
}
|
|
181
182
|
async function runInboxMessages(client, flags, out) {
|
|
182
183
|
rejectPreviewOnRead(flags.preview, out);
|
|
184
|
+
rejectPaginationModifiersWithoutAll(flags, out);
|
|
183
185
|
const retrieval = parseRetrievalFlags(flags);
|
|
184
186
|
if (!retrieval.ok) {
|
|
185
187
|
out.stderr.write(retrieval.error);
|
|
@@ -210,18 +212,31 @@ async function runInboxMessages(client, flags, out) {
|
|
|
210
212
|
out,
|
|
211
213
|
pageDelayMs: pageDelayFromFlags(flags)
|
|
212
214
|
})) {
|
|
213
|
-
out
|
|
215
|
+
writeNdjsonItem(out, item, outOpts.fields);
|
|
214
216
|
}
|
|
215
217
|
} else {
|
|
216
218
|
const result = await ns.messaging.listMessages(chatId, params);
|
|
219
|
+
readablePage(result);
|
|
217
220
|
renderSuccess(result, outOpts, out);
|
|
218
221
|
}
|
|
219
222
|
} catch (err) {
|
|
223
|
+
const { CurviateError } = await import("@curviate/sdk");
|
|
224
|
+
if (err instanceof CurviateError && err.code === "NOT_STORED") {
|
|
225
|
+
renderError(err, outOpts, out);
|
|
226
|
+
const servable = flags.before === void 0 && flags.after === void 0 && flags.cursor === void 0;
|
|
227
|
+
if (servable) {
|
|
228
|
+
out.stderr.write(
|
|
229
|
+
"hint: a stored listing is served only after a walk of the whole chat, which any unfiltered page fetch restarts. Run `curviate inbox messages <chat_id> --all` without `--mode cache_only` to walk it to the end. A chat whose messages do not fit one page (`--limit`, at most 25) is not served from the store at all.\n"
|
|
230
|
+
);
|
|
231
|
+
}
|
|
232
|
+
process.exit(14);
|
|
233
|
+
}
|
|
220
234
|
await handleSdkError(err, outOpts, out);
|
|
221
235
|
}
|
|
222
236
|
}
|
|
223
237
|
async function runInboxSearch(client, flags, out) {
|
|
224
238
|
rejectPreviewOnRead(flags.preview, out);
|
|
239
|
+
rejectPaginationModifiersWithoutAll(flags, out);
|
|
225
240
|
const accountId = await requireAccount(client, flags, out);
|
|
226
241
|
const query = flags.query ?? "";
|
|
227
242
|
if (!query) {
|
|
@@ -248,10 +263,11 @@ async function runInboxSearch(client, flags, out) {
|
|
|
248
263
|
out,
|
|
249
264
|
pageDelayMs: pageDelayFromFlags(flags)
|
|
250
265
|
})) {
|
|
251
|
-
out
|
|
266
|
+
writeNdjsonItem(out, item, outOpts.fields);
|
|
252
267
|
}
|
|
253
268
|
} else {
|
|
254
269
|
const result = await ns.messaging.searchChats(params);
|
|
270
|
+
readablePage(result);
|
|
255
271
|
renderSuccess(result, outOpts, out);
|
|
256
272
|
}
|
|
257
273
|
} catch (err) {
|
|
@@ -343,7 +359,7 @@ var inboxMarkReadCommand = defineCommand({
|
|
|
343
359
|
}
|
|
344
360
|
});
|
|
345
361
|
var inboxMessagesCommand = defineCommand({
|
|
346
|
-
meta: { name: "messages", description: "List messages in a chat. A very recent send/delete may take a few minutes to appear or clear here (LinkedIn-side indexing); `message get <chat_id> <message_id>` reflects it immediately." },
|
|
362
|
+
meta: { name: "messages", description: "List messages in a chat. A very recent send/delete may take a few minutes to appear or clear here (LinkedIn-side indexing); `message get <chat_id> <message_id>` reflects it immediately. `--mode cache_only` is answered only for an unfiltered, uncursored first page of a chat whose whole message set fits in that one page (`--limit`, at most 25), and only after a walk of the chat reached its end: any unfiltered page fetched from LinkedIn (such as `--mode live` without `--all`) restarts that walk, and `--all` walks to the end and closes it. A read carrying `--before`, `--after` or `--cursor` is never served from the store." },
|
|
347
363
|
args: {
|
|
348
364
|
...GLOBAL_FLAGS,
|
|
349
365
|
...RETRIEVAL_FLAGS,
|
|
@@ -1,27 +1,26 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
pageDelayFromFlags,
|
|
4
|
-
streamAll
|
|
5
|
-
} from "./chunk-LKF5MZIP.js";
|
|
6
2
|
import {
|
|
7
3
|
requireAccount
|
|
8
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-MNDXMGPX.js";
|
|
9
5
|
import {
|
|
6
|
+
pageDelayFromFlags,
|
|
7
|
+
readablePage,
|
|
8
|
+
rejectPaginationModifiersWithoutAll,
|
|
10
9
|
renderError,
|
|
11
10
|
renderSuccess,
|
|
12
|
-
renderUnexpectedError
|
|
13
|
-
|
|
11
|
+
renderUnexpectedError,
|
|
12
|
+
resolveEffectiveConfig,
|
|
13
|
+
streamAll,
|
|
14
|
+
writeNdjsonItem
|
|
15
|
+
} from "./chunk-7JU4IXXG.js";
|
|
16
|
+
import "./chunk-XZJQQJBE.js";
|
|
14
17
|
import {
|
|
15
|
-
createClient
|
|
16
|
-
|
|
17
|
-
} from "./chunk-TD2ZIXFR.js";
|
|
18
|
-
import "./chunk-PKSKQ3LN.js";
|
|
19
|
-
import "./chunk-EIEF2KFH.js";
|
|
20
|
-
import "./chunk-TQJ77SL4.js";
|
|
18
|
+
createClient
|
|
19
|
+
} from "./chunk-DCZR4M7G.js";
|
|
21
20
|
import {
|
|
22
21
|
GLOBAL_FLAGS,
|
|
23
22
|
READ_SINGLE_FLAGS
|
|
24
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-XDQHNUEU.js";
|
|
25
24
|
|
|
26
25
|
// src/commands/inboxes.ts
|
|
27
26
|
import { defineCommand } from "citty";
|
|
@@ -54,9 +53,9 @@ function resolveOutputOpts(flags) {
|
|
|
54
53
|
async function handleSdkError(err, outOpts, out) {
|
|
55
54
|
const { CurviateError } = await import("@curviate/sdk");
|
|
56
55
|
if (err instanceof CurviateError) {
|
|
57
|
-
const { getExitCode } = await import("./exit-codes-
|
|
56
|
+
const { getExitCode } = await import("./exit-codes-YSFFFWMS.js");
|
|
58
57
|
renderError(err, outOpts, out);
|
|
59
|
-
process.exit(getExitCode(err
|
|
58
|
+
process.exit(getExitCode(err));
|
|
60
59
|
}
|
|
61
60
|
renderUnexpectedError(err, out);
|
|
62
61
|
process.exit(1);
|
|
@@ -89,6 +88,7 @@ async function runInboxesList(client, flags, out) {
|
|
|
89
88
|
}
|
|
90
89
|
async function runInboxesChats(client, flags, out) {
|
|
91
90
|
rejectPreviewOnRead(flags.preview, out);
|
|
91
|
+
rejectPaginationModifiersWithoutAll(flags, out);
|
|
92
92
|
const accountId = await requireAccount(client, flags, out);
|
|
93
93
|
const inboxId = flags.inboxId ?? "";
|
|
94
94
|
const ns = client.account(accountId);
|
|
@@ -107,10 +107,11 @@ async function runInboxesChats(client, flags, out) {
|
|
|
107
107
|
out,
|
|
108
108
|
pageDelayMs: pageDelayFromFlags(flags)
|
|
109
109
|
})) {
|
|
110
|
-
out
|
|
110
|
+
writeNdjsonItem(out, item, outOpts.fields);
|
|
111
111
|
}
|
|
112
112
|
} else {
|
|
113
113
|
const result = await ns.inboxes.listChats(inboxId, params);
|
|
114
|
+
readablePage(result);
|
|
114
115
|
renderSuccess(result, outOpts, out);
|
|
115
116
|
}
|
|
116
117
|
} catch (err) {
|