@curviate/cli 0.10.0 → 0.12.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 +44 -1
- package/README.md +75 -5
- package/dist/account-NZBO6Y5I.js +1401 -0
- package/dist/{chunk-TDYIQHQX.js → chunk-4JHGVY7R.js} +3 -1
- package/dist/{exit-codes-NFIR57ZA.js → chunk-HMAGEMF7.js} +5 -1
- package/dist/{chunk-47SYFQRF.js → chunk-JXF47TRY.js} +1 -1
- package/dist/chunk-MKXA2LAR.js +51 -0
- package/dist/{chunk-CHFKVAEI.js → chunk-U7Y4EXHT.js} +1 -0
- package/dist/cli.js +18 -17
- package/dist/company-RU2CA5DY.js +337 -0
- package/dist/{config-2GBLD4GN.js → config-Q2AEWSEC.js} +1 -1
- package/dist/{connect-2OAOLYQO.js → connect-QT6ZOS75.js} +10 -10
- package/dist/exit-codes-ZTY2NY3X.js +11 -0
- package/dist/{inbox-AFVIF6ZU.js → inbox-DN7X7CM2.js} +3 -3
- package/dist/{job-QCKWY257.js → job-FGGQEXSU.js} +3 -3
- package/dist/{login-POKHNDYX.js → login-BBVQLXM7.js} +4 -49
- package/dist/{message-MP4TJJXS.js → message-6K5E3CUF.js} +4 -4
- package/dist/{post-Q3KR3TN3.js → post-2JQZ3OSF.js} +7 -7
- package/dist/{profile-2YE3IC3O.js → profile-DD5GMGNL.js} +10 -10
- package/dist/{recruiter-2CETQNCU.js → recruiter-XHVMQWK6.js} +6 -6
- package/dist/{sales-nav-SG6IXCTR.js → sales-nav-QTSTJMKA.js} +292 -14
- package/dist/{search-5BBFRE6T.js → search-ZGTS45BT.js} +7 -7
- package/dist/{webhook-7BJUYU4H.js → webhook-XPWBI675.js} +6 -6
- package/package.json +4 -3
- package/dist/account-XV3MU5S5.js +0 -649
- package/dist/company-QB7VCLXJ.js +0 -92
package/dist/company-QB7VCLXJ.js
DELETED
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
slimCompany
|
|
4
|
-
} from "./chunk-SSPILTKF.js";
|
|
5
|
-
import {
|
|
6
|
-
resolveIdentifier
|
|
7
|
-
} from "./chunk-DMQZEPQE.js";
|
|
8
|
-
import {
|
|
9
|
-
createClient,
|
|
10
|
-
renderError,
|
|
11
|
-
renderSuccess,
|
|
12
|
-
renderUnexpectedError,
|
|
13
|
-
resolveEffectiveConfig
|
|
14
|
-
} from "./chunk-47SYFQRF.js";
|
|
15
|
-
import {
|
|
16
|
-
GLOBAL_FLAGS
|
|
17
|
-
} from "./chunk-TDYIQHQX.js";
|
|
18
|
-
|
|
19
|
-
// src/commands/company.ts
|
|
20
|
-
import { defineCommand } from "citty";
|
|
21
|
-
function buildOutputStreams() {
|
|
22
|
-
return {
|
|
23
|
-
stdout: { write: (s) => process.stdout.write(s) },
|
|
24
|
-
stderr: { write: (s) => process.stderr.write(s) }
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
async function runCompanyGet(client, flags, out) {
|
|
28
|
-
if (flags.preview) {
|
|
29
|
-
out.stderr.write("error: --preview is only valid on write commands (mutations). Reads just run.\n");
|
|
30
|
-
process.exit(2);
|
|
31
|
-
}
|
|
32
|
-
if (flags.all) {
|
|
33
|
-
out.stderr.write("error: --all is not supported on non-paginated commands.\n");
|
|
34
|
-
process.exit(2);
|
|
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
|
-
}
|
|
40
|
-
const rawId = flags.id ?? "";
|
|
41
|
-
const resolvedId = resolveIdentifier(rawId);
|
|
42
|
-
const outOpts = {
|
|
43
|
-
json: (flags.json ?? false) || !process.stdout.isTTY,
|
|
44
|
-
isTTY: process.stdout.isTTY ?? false,
|
|
45
|
-
fields: flags.fields,
|
|
46
|
-
verbose: flags.verbose ?? false,
|
|
47
|
-
slim: slimCompany
|
|
48
|
-
};
|
|
49
|
-
try {
|
|
50
|
-
const getCompany = flags.account ? client.account(flags.account).profiles.getCompany.bind(client.account(flags.account).profiles) : client.profiles.getCompany.bind(client.profiles);
|
|
51
|
-
const result = await getCompany(resolvedId);
|
|
52
|
-
renderSuccess(result, outOpts, out);
|
|
53
|
-
} catch (err) {
|
|
54
|
-
const { CurviateError } = await import("@curviate/sdk");
|
|
55
|
-
if (err instanceof CurviateError) {
|
|
56
|
-
const { getExitCode } = await import("./exit-codes-NFIR57ZA.js");
|
|
57
|
-
renderError(err, outOpts, out);
|
|
58
|
-
process.exit(getExitCode(err.code));
|
|
59
|
-
}
|
|
60
|
-
renderUnexpectedError(err, out);
|
|
61
|
-
process.exit(1);
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
var companyCommand = defineCommand({
|
|
65
|
-
meta: { name: "company", description: "Fetch a company profile by URL or slug." },
|
|
66
|
-
args: {
|
|
67
|
-
...GLOBAL_FLAGS,
|
|
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." }
|
|
70
|
-
},
|
|
71
|
-
async run({ args }) {
|
|
72
|
-
const flags = args;
|
|
73
|
-
const cfg = await resolveEffectiveConfig({
|
|
74
|
-
apiKey: flags["api-key"],
|
|
75
|
-
baseUrl: flags["base-url"],
|
|
76
|
-
timeout: flags.timeout,
|
|
77
|
-
account: flags.account,
|
|
78
|
-
profile: flags.profile
|
|
79
|
-
});
|
|
80
|
-
if (!cfg.apiKey) {
|
|
81
|
-
process.stderr.write("error: no API key \u2014 run `curviate login` or pass --api-key.\n");
|
|
82
|
-
process.exit(3);
|
|
83
|
-
}
|
|
84
|
-
const client = createClient({ apiKey: cfg.apiKey, baseUrl: cfg.baseUrl, timeout: cfg.timeout });
|
|
85
|
-
const out = buildOutputStreams();
|
|
86
|
-
await runCompanyGet(client, { ...flags, account: flags.account ?? cfg.account }, out);
|
|
87
|
-
}
|
|
88
|
-
});
|
|
89
|
-
export {
|
|
90
|
-
companyCommand,
|
|
91
|
-
runCompanyGet
|
|
92
|
-
};
|