@chainpatrol/cli 1.0.0 → 1.2.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
CHANGED
|
@@ -1,5 +1,50 @@
|
|
|
1
1
|
# @chainpatrol/cli
|
|
2
2
|
|
|
3
|
+
## 1.2.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 3faffa0: Surface the sibling visibility knobs, brand-facing metadata, and portal
|
|
8
|
+
customization on the `/user/orgs` and `/user/orgs/{slug}` responses, on
|
|
9
|
+
`UserOrg` in the SDK, and in `chainpatrol orgs get` / `chainpatrol orgs list`
|
|
10
|
+
output (human, markdown, CSV, and JSON):
|
|
11
|
+
|
|
12
|
+
- `reportVisibility` (`PUBLIC` / `PRIVATE`) — sibling of `portalVisibility`.
|
|
13
|
+
- `metricsVisibility` (`PUBLIC` / `PRIVATE` / `DISABLED`) — sibling of the
|
|
14
|
+
above.
|
|
15
|
+
- `brandMetadata` — `{ websiteUrl, twitterHandle, securityContactEmail,
|
|
16
|
+
industry }`, all nullable.
|
|
17
|
+
- `portalCustomization` — `{ useCustomDetails, name, slug, avatarUrl,
|
|
18
|
+
bannerEnabled, bannerContent }` for the customer-configurable portal
|
|
19
|
+
presentation.
|
|
20
|
+
|
|
21
|
+
Server-side work in `@chainpatrol/external-trpc` and `@chainpatrol/validation`
|
|
22
|
+
supports the new fields; both are private packages and don't need version
|
|
23
|
+
bumps.
|
|
24
|
+
|
|
25
|
+
### Patch Changes
|
|
26
|
+
|
|
27
|
+
- Updated dependencies [3faffa0]
|
|
28
|
+
- @chainpatrol/sdk@1.2.0
|
|
29
|
+
|
|
30
|
+
## 1.1.0
|
|
31
|
+
|
|
32
|
+
### Minor Changes
|
|
33
|
+
|
|
34
|
+
- 6def719: Surface `portalVisibility` (PUBLIC / PRIVATE / DISABLED) on the `/user/orgs`
|
|
35
|
+
and `/user/orgs/{slug}` API responses, on `UserOrg` in the SDK, and in the
|
|
36
|
+
`chainpatrol orgs list` / `chainpatrol orgs get` CLI output (human, markdown,
|
|
37
|
+
CSV, and JSON). Server-side changes in `@chainpatrol/external-trpc` and
|
|
38
|
+
`@chainpatrol/validation` back the new field; both are private packages and
|
|
39
|
+
don't need version bumps.
|
|
40
|
+
|
|
41
|
+
### Patch Changes
|
|
42
|
+
|
|
43
|
+
- 239bfdc: Remove non-zero exit throwing from `chainpatrol healthchecks run` when checks fail
|
|
44
|
+
or error, while preserving failure details in command output.
|
|
45
|
+
- Updated dependencies [6def719]
|
|
46
|
+
- @chainpatrol/sdk@1.1.0
|
|
47
|
+
|
|
3
48
|
## 1.0.0
|
|
4
49
|
|
|
5
50
|
### Major Changes
|
package/dist/cli.js
CHANGED
|
@@ -1606,7 +1606,7 @@ async function main() {
|
|
|
1606
1606
|
}
|
|
1607
1607
|
case "orgs": {
|
|
1608
1608
|
if (subcommand === "list") {
|
|
1609
|
-
const { runOrgsList } = await import("./list-
|
|
1609
|
+
const { runOrgsList } = await import("./list-BAPTZNTM.js");
|
|
1610
1610
|
await runOrgsList({
|
|
1611
1611
|
query: cli.flags.query,
|
|
1612
1612
|
subscriptionStatus: cli.flags.subscriptionStatus,
|
|
@@ -1628,7 +1628,7 @@ async function main() {
|
|
|
1628
1628
|
if (subcommand === "get") {
|
|
1629
1629
|
const positionalSlug = action;
|
|
1630
1630
|
const slug = positionalSlug ?? await tryResolveOrg();
|
|
1631
|
-
const { runOrgsGet } = await import("./get-
|
|
1631
|
+
const { runOrgsGet } = await import("./get-SM5KGJVA.js");
|
|
1632
1632
|
await runOrgsGet({
|
|
1633
1633
|
slug,
|
|
1634
1634
|
json: jsonMode,
|
|
@@ -1713,7 +1713,7 @@ async function main() {
|
|
|
1713
1713
|
thresholds.minResults = cli.flags.minResults;
|
|
1714
1714
|
if (cli.flags.lookbackHours !== void 0)
|
|
1715
1715
|
thresholds.lookbackHours = cli.flags.lookbackHours;
|
|
1716
|
-
const { runHealthchecksRun } = await import("./run-
|
|
1716
|
+
const { runHealthchecksRun } = await import("./run-RRG7D4SN.js");
|
|
1717
1717
|
await runHealthchecksRun({
|
|
1718
1718
|
org,
|
|
1719
1719
|
id: action,
|
|
@@ -56,6 +56,27 @@ function summarizeLegalDocuments(org) {
|
|
|
56
56
|
const poa = org.legalDocuments.powerOfAttorney.present ? "yes" : "no";
|
|
57
57
|
return `LOA=${loa} POA=${poa}`;
|
|
58
58
|
}
|
|
59
|
+
function summarizeVisibility(org) {
|
|
60
|
+
return `portal=${org.portalVisibility} reports=${org.reportVisibility} metrics=${org.metricsVisibility}`;
|
|
61
|
+
}
|
|
62
|
+
function summarizeBrandMetadata(org) {
|
|
63
|
+
const { websiteUrl, twitterHandle, securityContactEmail, industry } = org.brandMetadata;
|
|
64
|
+
const parts = [];
|
|
65
|
+
if (industry) parts.push(`industry=${industry}`);
|
|
66
|
+
if (websiteUrl) parts.push(`website=${websiteUrl}`);
|
|
67
|
+
if (twitterHandle) parts.push(`twitter=${twitterHandle}`);
|
|
68
|
+
if (securityContactEmail) parts.push(`security-contact=${securityContactEmail}`);
|
|
69
|
+
return parts.length > 0 ? parts.join(" ") : "(none set)";
|
|
70
|
+
}
|
|
71
|
+
function summarizePortalCustomization(org) {
|
|
72
|
+
const c = org.portalCustomization;
|
|
73
|
+
const parts = [];
|
|
74
|
+
parts.push(c.useCustomDetails ? "custom-details=on" : "custom-details=off");
|
|
75
|
+
if (c.name) parts.push(`name=${c.name}`);
|
|
76
|
+
if (c.slug) parts.push(`slug=${c.slug}`);
|
|
77
|
+
parts.push(c.bannerEnabled ? "banner=on" : "banner=off");
|
|
78
|
+
return parts.join(" ");
|
|
79
|
+
}
|
|
59
80
|
function summarizeTrademarks(org) {
|
|
60
81
|
const count = org.trademarkRegistrations.length;
|
|
61
82
|
if (count === 0) return "none";
|
|
@@ -82,6 +103,11 @@ async function runOrgsGet(options) {
|
|
|
82
103
|
"",
|
|
83
104
|
`- Contact URL: ${organization.contactUrl ?? "(not set)"}`,
|
|
84
105
|
`- Subscription status: ${organization.subscriptionStatus}`,
|
|
106
|
+
`- Visibility: ${summarizeVisibility(organization)}`,
|
|
107
|
+
`- Brand metadata: ${summarizeBrandMetadata(organization)}`,
|
|
108
|
+
`- Portal customization: ${summarizePortalCustomization(organization)}`,
|
|
109
|
+
organization.portalCustomization.avatarUrl ? ` - Custom avatar: ${organization.portalCustomization.avatarUrl}` : "",
|
|
110
|
+
organization.portalCustomization.bannerEnabled && organization.portalCustomization.bannerContent ? ` - Banner content: ${organization.portalCustomization.bannerContent}` : "",
|
|
85
111
|
`- Services: ${summarizeServices(organization)}`,
|
|
86
112
|
`- Integrations: ${summarizeIntegrations(organization)}`,
|
|
87
113
|
`- Obligatory admin approval: ${summarizeObligatoryAdminApproval(organization)}`,
|
|
@@ -100,6 +126,19 @@ async function runOrgsGet(options) {
|
|
|
100
126
|
name: organization.name,
|
|
101
127
|
contactUrl: organization.contactUrl ?? "",
|
|
102
128
|
subscriptionStatus: organization.subscriptionStatus,
|
|
129
|
+
portalVisibility: organization.portalVisibility,
|
|
130
|
+
reportVisibility: organization.reportVisibility,
|
|
131
|
+
metricsVisibility: organization.metricsVisibility,
|
|
132
|
+
industry: organization.brandMetadata.industry ?? "",
|
|
133
|
+
websiteUrl: organization.brandMetadata.websiteUrl ?? "",
|
|
134
|
+
twitterHandle: organization.brandMetadata.twitterHandle ?? "",
|
|
135
|
+
securityContactEmail: organization.brandMetadata.securityContactEmail ?? "",
|
|
136
|
+
portalUseCustomDetails: organization.portalCustomization.useCustomDetails,
|
|
137
|
+
portalName: organization.portalCustomization.name ?? "",
|
|
138
|
+
portalSlug: organization.portalCustomization.slug ?? "",
|
|
139
|
+
portalAvatarUrl: organization.portalCustomization.avatarUrl ?? "",
|
|
140
|
+
portalBannerEnabled: organization.portalCustomization.bannerEnabled,
|
|
141
|
+
portalBannerContent: organization.portalCustomization.bannerContent ?? "",
|
|
103
142
|
reportingActive: organization.services.reporting.active,
|
|
104
143
|
reviewingActive: organization.services.reviewing.active,
|
|
105
144
|
protectionActive: organization.services.protection.active,
|
|
@@ -133,6 +172,17 @@ async function runOrgsGet(options) {
|
|
|
133
172
|
console.log(`${organization.name} (slug: ${organization.slug})`);
|
|
134
173
|
console.log(` contactUrl: ${organization.contactUrl ?? "(not set)"}`);
|
|
135
174
|
console.log(` subscriptionStatus: ${organization.subscriptionStatus}`);
|
|
175
|
+
console.log(` visibility: ${summarizeVisibility(organization)}`);
|
|
176
|
+
console.log(` brandMetadata: ${summarizeBrandMetadata(organization)}`);
|
|
177
|
+
console.log(` portalCustomization: ${summarizePortalCustomization(organization)}`);
|
|
178
|
+
if (organization.portalCustomization.avatarUrl) {
|
|
179
|
+
console.log(` custom avatar: ${organization.portalCustomization.avatarUrl}`);
|
|
180
|
+
}
|
|
181
|
+
if (organization.portalCustomization.bannerEnabled && organization.portalCustomization.bannerContent) {
|
|
182
|
+
console.log(
|
|
183
|
+
` banner content: ${organization.portalCustomization.bannerContent}`
|
|
184
|
+
);
|
|
185
|
+
}
|
|
136
186
|
console.log(` services: ${summarizeServices(organization)}`);
|
|
137
187
|
console.log(` integrations: ${summarizeIntegrations(organization)}`);
|
|
138
188
|
console.log(
|
|
@@ -215,6 +215,9 @@ function summarizeLegalDocuments(org) {
|
|
|
215
215
|
const poa = org.legalDocuments.powerOfAttorney.present ? "yes" : "no";
|
|
216
216
|
return `LOA=${loa} POA=${poa}`;
|
|
217
217
|
}
|
|
218
|
+
function summarizeVisibility(org) {
|
|
219
|
+
return `portal=${org.portalVisibility} reports=${org.reportVisibility} metrics=${org.metricsVisibility}`;
|
|
220
|
+
}
|
|
218
221
|
function summarizeTrademarks(org) {
|
|
219
222
|
const count = org.trademarkRegistrations.length;
|
|
220
223
|
return count === 0 ? "0" : `${count}`;
|
|
@@ -238,7 +241,7 @@ async function runOrgsList(options) {
|
|
|
238
241
|
`# Organizations (${organizations.length})`,
|
|
239
242
|
"",
|
|
240
243
|
...organizations.map(
|
|
241
|
-
(org) => `- \`${org.slug}\` \u2014 ${org.name} \u2014 ${org.subscriptionStatus} \u2014 contact: ${org.contactUrl ?? "(not set)"} \u2014 ${summarizeServices(org)} \u2014 integrations: ${summarizeIntegrations(org)} \u2014 admin-approval: ${summarizeObligatoryAdminApproval(org)} \u2014 pending-approval: ${summarizePendingApprovals(org)} \u2014 legal: ${summarizeLegalDocuments(org)} \u2014 trademarks: ${summarizeTrademarks(org)}`
|
|
244
|
+
(org) => `- \`${org.slug}\` \u2014 ${org.name} \u2014 ${org.subscriptionStatus} \u2014 visibility: ${summarizeVisibility(org)} \u2014 contact: ${org.contactUrl ?? "(not set)"} \u2014 ${summarizeServices(org)} \u2014 integrations: ${summarizeIntegrations(org)} \u2014 admin-approval: ${summarizeObligatoryAdminApproval(org)} \u2014 pending-approval: ${summarizePendingApprovals(org)} \u2014 legal: ${summarizeLegalDocuments(org)} \u2014 trademarks: ${summarizeTrademarks(org)}`
|
|
242
245
|
)
|
|
243
246
|
].join("\n"),
|
|
244
247
|
csv: toCsvRows(
|
|
@@ -247,6 +250,19 @@ async function runOrgsList(options) {
|
|
|
247
250
|
name: org.name,
|
|
248
251
|
contactUrl: org.contactUrl ?? "",
|
|
249
252
|
subscriptionStatus: org.subscriptionStatus,
|
|
253
|
+
portalVisibility: org.portalVisibility,
|
|
254
|
+
reportVisibility: org.reportVisibility,
|
|
255
|
+
metricsVisibility: org.metricsVisibility,
|
|
256
|
+
industry: org.brandMetadata.industry ?? "",
|
|
257
|
+
websiteUrl: org.brandMetadata.websiteUrl ?? "",
|
|
258
|
+
twitterHandle: org.brandMetadata.twitterHandle ?? "",
|
|
259
|
+
securityContactEmail: org.brandMetadata.securityContactEmail ?? "",
|
|
260
|
+
portalUseCustomDetails: org.portalCustomization.useCustomDetails,
|
|
261
|
+
portalName: org.portalCustomization.name ?? "",
|
|
262
|
+
portalSlug: org.portalCustomization.slug ?? "",
|
|
263
|
+
portalAvatarUrl: org.portalCustomization.avatarUrl ?? "",
|
|
264
|
+
portalBannerEnabled: org.portalCustomization.bannerEnabled,
|
|
265
|
+
portalBannerContent: org.portalCustomization.bannerContent ?? "",
|
|
250
266
|
reportingActive: org.services.reporting.active,
|
|
251
267
|
reviewingActive: org.services.reviewing.active,
|
|
252
268
|
protectionActive: org.services.protection.active,
|
|
@@ -285,7 +301,7 @@ async function runOrgsList(options) {
|
|
|
285
301
|
for (const org of organizations) {
|
|
286
302
|
const contact = org.contactUrl ?? "(no contact)";
|
|
287
303
|
console.log(
|
|
288
|
-
` ${org.slug.padEnd(slugWidth)} ${org.name.padEnd(nameWidth)} ${org.subscriptionStatus.padEnd(11)} ${contact} ${summarizeServices(org)} integrations=${summarizeIntegrations(org)} admin-approval=${summarizeObligatoryAdminApproval(org)} pending-approval=${summarizePendingApprovals(org)} legal=${summarizeLegalDocuments(org)} trademarks=${summarizeTrademarks(org)}`
|
|
304
|
+
` ${org.slug.padEnd(slugWidth)} ${org.name.padEnd(nameWidth)} ${org.subscriptionStatus.padEnd(11)} visibility=${summarizeVisibility(org)} ${contact} ${summarizeServices(org)} integrations=${summarizeIntegrations(org)} admin-approval=${summarizeObligatoryAdminApproval(org)} pending-approval=${summarizePendingApprovals(org)} legal=${summarizeLegalDocuments(org)} trademarks=${summarizeTrademarks(org)}`
|
|
289
305
|
);
|
|
290
306
|
}
|
|
291
307
|
}
|
|
@@ -208,12 +208,6 @@ async function runHealthchecksRun(options) {
|
|
|
208
208
|
}
|
|
209
209
|
}
|
|
210
210
|
});
|
|
211
|
-
if (!overallOk) {
|
|
212
|
-
throw new CliExitError(
|
|
213
|
-
"One or more healthchecks failed or errored.",
|
|
214
|
-
ExitCode.CHECK_FAILED
|
|
215
|
-
);
|
|
216
|
-
}
|
|
217
211
|
}
|
|
218
212
|
export {
|
|
219
213
|
runHealthchecksRun
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@chainpatrol/cli",
|
|
3
3
|
"description": "The official ChainPatrol CLI — terminal interface for threat detection",
|
|
4
4
|
"author": "Umar Ahmed <umar@chainpatrol.io>",
|
|
5
|
-
"version": "1.
|
|
5
|
+
"version": "1.2.0",
|
|
6
6
|
"license": "UNLICENSED",
|
|
7
7
|
"homepage": "https://chainpatrol.com/docs/cli",
|
|
8
8
|
"keywords": [
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"lint": "npx oxlint ."
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@chainpatrol/sdk": "1.
|
|
36
|
+
"@chainpatrol/sdk": "1.2.0",
|
|
37
37
|
"ink": "^7.0.1",
|
|
38
38
|
"meow": "^14.1.0",
|
|
39
39
|
"open": "^11.0.0",
|