@chainpatrol/cli 1.1.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,32 @@
|
|
|
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
|
+
|
|
3
30
|
## 1.1.0
|
|
4
31
|
|
|
5
32
|
### Minor 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,
|
|
@@ -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,7 +103,11 @@ async function runOrgsGet(options) {
|
|
|
82
103
|
"",
|
|
83
104
|
`- Contact URL: ${organization.contactUrl ?? "(not set)"}`,
|
|
84
105
|
`- Subscription status: ${organization.subscriptionStatus}`,
|
|
85
|
-
`-
|
|
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}` : "",
|
|
86
111
|
`- Services: ${summarizeServices(organization)}`,
|
|
87
112
|
`- Integrations: ${summarizeIntegrations(organization)}`,
|
|
88
113
|
`- Obligatory admin approval: ${summarizeObligatoryAdminApproval(organization)}`,
|
|
@@ -102,6 +127,18 @@ async function runOrgsGet(options) {
|
|
|
102
127
|
contactUrl: organization.contactUrl ?? "",
|
|
103
128
|
subscriptionStatus: organization.subscriptionStatus,
|
|
104
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 ?? "",
|
|
105
142
|
reportingActive: organization.services.reporting.active,
|
|
106
143
|
reviewingActive: organization.services.reviewing.active,
|
|
107
144
|
protectionActive: organization.services.protection.active,
|
|
@@ -135,7 +172,17 @@ async function runOrgsGet(options) {
|
|
|
135
172
|
console.log(`${organization.name} (slug: ${organization.slug})`);
|
|
136
173
|
console.log(` contactUrl: ${organization.contactUrl ?? "(not set)"}`);
|
|
137
174
|
console.log(` subscriptionStatus: ${organization.subscriptionStatus}`);
|
|
138
|
-
console.log(`
|
|
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
|
+
}
|
|
139
186
|
console.log(` services: ${summarizeServices(organization)}`);
|
|
140
187
|
console.log(` integrations: ${summarizeIntegrations(organization)}`);
|
|
141
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
|
|
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(
|
|
@@ -248,6 +251,18 @@ async function runOrgsList(options) {
|
|
|
248
251
|
contactUrl: org.contactUrl ?? "",
|
|
249
252
|
subscriptionStatus: org.subscriptionStatus,
|
|
250
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 ?? "",
|
|
251
266
|
reportingActive: org.services.reporting.active,
|
|
252
267
|
reviewingActive: org.services.reviewing.active,
|
|
253
268
|
protectionActive: org.services.protection.active,
|
|
@@ -286,7 +301,7 @@ async function runOrgsList(options) {
|
|
|
286
301
|
for (const org of organizations) {
|
|
287
302
|
const contact = org.contactUrl ?? "(no contact)";
|
|
288
303
|
console.log(
|
|
289
|
-
` ${org.slug.padEnd(slugWidth)} ${org.name.padEnd(nameWidth)} ${org.subscriptionStatus.padEnd(11)}
|
|
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)}`
|
|
290
305
|
);
|
|
291
306
|
}
|
|
292
307
|
}
|
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",
|