@chainpatrol/cli 1.8.0 → 1.9.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,16 @@
|
|
|
1
1
|
# @chainpatrol/cli
|
|
2
2
|
|
|
3
|
+
## 1.9.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 9347b6a: Add `takedownsInProgress` and `takedownsCancelled` to the `/organization/metrics` endpoint, available as `--include` values and as fields on the metrics payload.
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [9347b6a]
|
|
12
|
+
- @chainpatrol/sdk@1.9.0
|
|
13
|
+
|
|
3
14
|
## 1.8.0
|
|
4
15
|
|
|
5
16
|
### Minor Changes
|
package/dist/cli.js
CHANGED
|
@@ -304,7 +304,7 @@ var HELP = {
|
|
|
304
304
|
"--from <iso> Start date (ISO 8601, e.g. 2026-01-01)",
|
|
305
305
|
"--to <iso> End date (ISO 8601)",
|
|
306
306
|
"--this-week Use the current ISO week (overrides default)",
|
|
307
|
-
"--include <list> Comma list of fields to compute: reports,newThreats,threatsWatchlisted,takedownsFiled,takedownsCompleted,domainThreats,twitterThreats,telegramThreats,otherThreats,blockedByType,blockedByDay (omit for all)"
|
|
307
|
+
"--include <list> Comma list of fields to compute: reports,newThreats,threatsWatchlisted,takedownsFiled,takedownsInProgress,takedownsCompleted,takedownsCancelled,domainThreats,twitterThreats,telegramThreats,otherThreats,blockedByType,blockedByDay (omit for all)"
|
|
308
308
|
],
|
|
309
309
|
examples: [
|
|
310
310
|
"chainpatrol metrics organization --org acme # defaults to last 3 months",
|
|
@@ -1491,7 +1491,7 @@ async function main() {
|
|
|
1491
1491
|
const slugs = parseCsvList(cli.flags.slugs);
|
|
1492
1492
|
const allMyOrgs = cli.flags.allMyOrgs;
|
|
1493
1493
|
const org2 = slugs && slugs.length > 0 || allMyOrgs ? void 0 : await tryResolveOrg();
|
|
1494
|
-
const { runMetricsOrganization } = await import("./organization-
|
|
1494
|
+
const { runMetricsOrganization } = await import("./organization-SSCPM7XN.js");
|
|
1495
1495
|
await runMetricsOrganization({
|
|
1496
1496
|
org: org2,
|
|
1497
1497
|
slugs,
|
|
@@ -42,7 +42,9 @@ var METRIC_LABELS = [
|
|
|
42
42
|
["newThreats", "New threats"],
|
|
43
43
|
["threatsWatchlisted", "Watchlisted threats"],
|
|
44
44
|
["takedownsFiled", "Takedowns filed"],
|
|
45
|
+
["takedownsInProgress", "Takedowns in-progress"],
|
|
45
46
|
["takedownsCompleted", "Takedowns completed"],
|
|
47
|
+
["takedownsCancelled", "Takedowns cancelled"],
|
|
46
48
|
["domainThreats", "Domain threats"],
|
|
47
49
|
["twitterThreats", "Twitter threats"],
|
|
48
50
|
["telegramThreats", "Telegram threats"],
|
|
@@ -66,10 +68,9 @@ function formatAverage(value) {
|
|
|
66
68
|
return Number.isInteger(value) ? String(value) : value.toFixed(2);
|
|
67
69
|
}
|
|
68
70
|
function populatedMetricRows(metrics, format = (v) => String(v)) {
|
|
69
|
-
return METRIC_LABELS.filter(([key]) => metrics[key] !== null).map(
|
|
70
|
-
label,
|
|
71
|
-
|
|
72
|
-
]);
|
|
71
|
+
return METRIC_LABELS.filter(([key]) => (metrics[key] ?? null) !== null).map(
|
|
72
|
+
([key, label]) => [label, format(metrics[key] ?? null)]
|
|
73
|
+
);
|
|
73
74
|
}
|
|
74
75
|
async function runMetricsOrganization(options) {
|
|
75
76
|
const explicitForms = [
|
|
@@ -231,7 +232,9 @@ function buildCsvRows({
|
|
|
231
232
|
newThreats: metrics.newThreats,
|
|
232
233
|
threatsWatchlisted: metrics.threatsWatchlisted,
|
|
233
234
|
takedownsFiled: metrics.takedownsFiled,
|
|
235
|
+
takedownsInProgress: metrics.takedownsInProgress,
|
|
234
236
|
takedownsCompleted: metrics.takedownsCompleted,
|
|
237
|
+
takedownsCancelled: metrics.takedownsCancelled,
|
|
235
238
|
domainThreats: metrics.domainThreats,
|
|
236
239
|
twitterThreats: metrics.twitterThreats,
|
|
237
240
|
telegramThreats: metrics.telegramThreats,
|
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.9.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.9.0",
|
|
37
37
|
"ink": "^7.0.1",
|
|
38
38
|
"meow": "^14.1.0",
|
|
39
39
|
"open": "^11.0.0",
|