@chainpatrol/cli 1.8.0 → 1.10.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,29 @@
1
1
  # @chainpatrol/cli
2
2
 
3
+ ## 1.10.0
4
+
5
+ ### Minor Changes
6
+
7
+ - f65141b: Allow listing inactive organizations: `orgs list --subscription-status INACTIVE` (and the `subscriptionStatus` filter on `/user/orgs` and `/organization/metrics`) now accepts `INACTIVE`. Unfiltered calls are unchanged and still return only the live statuses.
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies [38025fe]
12
+ - Updated dependencies [f65141b]
13
+ - Updated dependencies [d6124a4]
14
+ - @chainpatrol/sdk@1.10.0
15
+
16
+ ## 1.9.0
17
+
18
+ ### Minor Changes
19
+
20
+ - 9347b6a: Add `takedownsInProgress` and `takedownsCancelled` to the `/organization/metrics` endpoint, available as `--include` values and as fields on the metrics payload.
21
+
22
+ ### Patch Changes
23
+
24
+ - Updated dependencies [9347b6a]
25
+ - @chainpatrol/sdk@1.9.0
26
+
3
27
  ## 1.8.0
4
28
 
5
29
  ### Minor Changes
package/dist/cli.js CHANGED
@@ -298,13 +298,13 @@ var HELP = {
298
298
  "--org <slug> Single org. Mutually exclusive with --slugs and --all-my-orgs.",
299
299
  "--slugs <list> Comma list of org slugs (cap 500). Response is the rollup across these orgs.",
300
300
  "--all-my-orgs Shortcut for 'every org I can see'. Server resolves via the same logic as `orgs list` (org-scoped API keys are rejected). Cap 500 \u2014 narrow with --subscription-status / --service-active if you have more.",
301
- "--subscription-status <list> With --all-my-orgs: only ACTIVE / POC / PROSPECT / INTEGRATION (default: same set as `orgs list`).",
301
+ "--subscription-status <list> With --all-my-orgs: ACTIVE / POC / PROSPECT / INTEGRATION / INACTIVE (default: same live set as `orgs list`).",
302
302
  "--service-active <list> With --all-my-orgs: only orgs with the listed service(s) active. Allowed: reporting, reviewing, protection, takedowns, detection, darkWebMonitoring.",
303
303
  "--brand-slug <slug> Filter by brand slug (requires brands-metrics flag; single-org only).",
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",
@@ -610,7 +610,7 @@ var HELP = {
610
610
  usage: "chainpatrol orgs list [filters]",
611
611
  options: [
612
612
  "--query <text> Partial name match (substring, case-insensitive)",
613
- "--subscription-status <l> Comma-separated list (PROSPECT,POC,ACTIVE,INTEGRATION)",
613
+ "--subscription-status <l> Comma-separated list (PROSPECT,POC,ACTIVE,INTEGRATION,INACTIVE). Defaults to the live statuses \u2014 pass INACTIVE to list churned orgs.",
614
614
  "--service-active <l> Comma-separated services that must be active",
615
615
  "--service-inactive <l> Comma-separated services that must be inactive",
616
616
  "--service-automated <l> Services whose automation must be ON (only `takedowns` is accepted \u2014 the other services have no meaningful automation toggle)",
@@ -623,7 +623,8 @@ var HELP = {
623
623
  "chainpatrol orgs list --subscription-status ACTIVE",
624
624
  "chainpatrol orgs list --service-active takedowns --service-manual takedowns",
625
625
  "chainpatrol --json orgs list --subscription-status ACTIVE,POC --service-active detection",
626
- "chainpatrol --json orgs list --pending-approval-service protection,takedowns"
626
+ "chainpatrol --json orgs list --pending-approval-service protection,takedowns",
627
+ "chainpatrol orgs list --subscription-status INACTIVE --service-active detection # churned orgs still running detection"
627
628
  ]
628
629
  },
629
630
  "orgs get": {
@@ -1491,7 +1492,7 @@ async function main() {
1491
1492
  const slugs = parseCsvList(cli.flags.slugs);
1492
1493
  const allMyOrgs = cli.flags.allMyOrgs;
1493
1494
  const org2 = slugs && slugs.length > 0 || allMyOrgs ? void 0 : await tryResolveOrg();
1494
- const { runMetricsOrganization } = await import("./organization-YAID36GZ.js");
1495
+ const { runMetricsOrganization } = await import("./organization-SSCPM7XN.js");
1495
1496
  await runMetricsOrganization({
1496
1497
  org: org2,
1497
1498
  slugs,
@@ -1765,7 +1766,7 @@ async function main() {
1765
1766
  }
1766
1767
  case "orgs": {
1767
1768
  if (subcommand === "list") {
1768
- const { runOrgsList } = await import("./list-MHOHKFXT.js");
1769
+ const { runOrgsList } = await import("./list-XV3G2AX6.js");
1769
1770
  await runOrgsList({
1770
1771
  query: cli.flags.query,
1771
1772
  subscriptionStatus: cli.flags.subscriptionStatus,
@@ -17,7 +17,10 @@ var VALID_SUBSCRIPTION_STATUSES = /* @__PURE__ */ new Set([
17
17
  "PROSPECT",
18
18
  "POC",
19
19
  "ACTIVE",
20
- "INTEGRATION"
20
+ "INTEGRATION",
21
+ // Churned orgs are excluded by default server-side; asking for INACTIVE
22
+ // explicitly is the only way to list them.
23
+ "INACTIVE"
21
24
  ]);
22
25
  var DUAL_SERVICES = ["takedowns"];
23
26
  var SINGLE_SERVICES = [
@@ -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(([key, label]) => [
70
- label,
71
- format(metrics[key])
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.8.0",
5
+ "version": "1.10.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.8.0",
36
+ "@chainpatrol/sdk": "1.10.0",
37
37
  "ink": "^7.0.1",
38
38
  "meow": "^14.1.0",
39
39
  "open": "^11.0.0",