@chainpatrol/cli 0.23.0 → 0.24.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,27 @@
1
1
  # @chainpatrol/cli
2
2
 
3
+ ## 0.24.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 2824e5c: Add filter-aware `totalCount` to `reports list`. The reports list response (and
8
+ `chainpatrol --json reports list`) now returns `totalCount`: the number of
9
+ reports matching the same filters as the query, independent of `--limit` /
10
+ `--cursor`. Consumers can use it as a denominator when sampling (e.g. "sampled
11
+ 200 of ~4,235"), to decide whether to page through or narrow filters up front,
12
+ and to drive a progress indicator. Server-side work lives in `@chainpatrol/core`
13
+ and `@chainpatrol/external-trpc` (both private packages, no version bump needed).
14
+
15
+ ## 0.23.1
16
+
17
+ ### Patch Changes
18
+
19
+ - 0f1d7d1: Fix `asset search` bulk lookups by ID. The `--id` (and `--asset`) flags are
20
+ documented and handled as repeatable for bulk lookup, but meow rejected the
21
+ second occurrence with `The flag --id can only be set once.`. Mark both flags
22
+ `isMultiple` so `chainpatrol asset search --id 1 --id 2 --id 3` works as
23
+ advertised instead of erroring out.
24
+
3
25
  ## 0.23.0
4
26
 
5
27
  ### Minor Changes
package/README.md CHANGED
@@ -125,6 +125,11 @@ chainpatrol reports list --org my-org --limit 5
125
125
  chainpatrol reports list --org my-org --status TODO --search "Phishing report"
126
126
  ```
127
127
 
128
+ `reports list` responses include `totalCount` — the number of reports matching
129
+ the current filters, independent of `--limit`/`--cursor`. Use it as a
130
+ denominator when sampling (e.g. "sampled 200 of ~4,235") or to decide whether to
131
+ paginate vs. narrow filters before fetching.
132
+
128
133
  ### Operations commands
129
134
 
130
135
  ```bash
@@ -465,6 +465,20 @@ JSON mode is recommended when you want to analyze the data programmatically:
465
465
  chainpatrol --json reports list --org <slug> --reported-by-customer
466
466
  \`\`\`
467
467
 
468
+ The response includes \`totalCount\`: the number of reports matching the same
469
+ filters as the query, independent of \`--limit\`/\`--cursor\`. Use it to:
470
+ - Report a denominator when sampling (e.g. "sampled 200 of ~4,235").
471
+ - Decide up front whether to page through everything or narrow filters first \u2014
472
+ if \`totalCount\` is huge, add more filters instead of paginating blindly.
473
+ - Drive a progress indicator while paginating with \`nextCursor\`.
474
+
475
+ \`totalCount\` honors every list filter (\`--status\`, \`--reported-by-customer\` /
476
+ \`--no-reported-by-customer\`, \`--exclude-automation\`, \`--review-status\` /
477
+ \`--only-rejected\`, \`--asset-type\`, brand, \`--country-code\`, \`--from\`/\`--to\`,
478
+ \`--updated-from\`/\`--updated-to\`, \`--search\`, \`--reporter-query\`), so changing
479
+ filters changes the count. \`reports\` (the returned page) is capped by
480
+ \`--limit\` (max 20); \`totalCount\` is not.
481
+
468
482
  #### Use case: finding gaps in ChainPatrol detection
469
483
 
470
484
  Customer-reported reports (\`reportedByCustomer=true\`) are a valuable signal
package/dist/cli.js CHANGED
@@ -13,7 +13,7 @@ import {
13
13
  getCliVersion,
14
14
  isSkillInstalled,
15
15
  readInstalledSkillVersion
16
- } from "./chunk-LKITFBIG.js";
16
+ } from "./chunk-4RKRCENC.js";
17
17
  import "./chunk-6VTWWGNV.js";
18
18
  import {
19
19
  DateTime
@@ -921,7 +921,7 @@ ${getTopLevelHelp()}
921
921
  description: { type: "string" },
922
922
  cron: { type: "string" },
923
923
  mergeConfig: { type: "boolean", default: true },
924
- asset: { type: "string" },
924
+ asset: { type: "string", isMultiple: true },
925
925
  limit: { type: "number" },
926
926
  cursor: { type: "number" },
927
927
  status: { type: "string" },
@@ -978,7 +978,7 @@ ${getTopLevelHelp()}
978
978
  noInput: { type: "boolean", default: false },
979
979
  noColor: { type: "boolean", default: false },
980
980
  cloud: { type: "boolean", default: false },
981
- id: { type: "string" }
981
+ id: { type: "string", isMultiple: true }
982
982
  }
983
983
  });
984
984
  var [command, subcommand, action] = cli.input;
@@ -1469,7 +1469,7 @@ async function main() {
1469
1469
  case "reports": {
1470
1470
  if (subcommand === "list") {
1471
1471
  const org = await resolveOrg();
1472
- const { runReportsList } = await import("./list-H7NVUX42.js");
1472
+ const { runReportsList } = await import("./list-735RYNAF.js");
1473
1473
  await runReportsList({
1474
1474
  org,
1475
1475
  limit: cli.flags.limit,
@@ -1759,12 +1759,12 @@ async function main() {
1759
1759
  case "setup":
1760
1760
  case "install":
1761
1761
  case "i": {
1762
- const { setupSkill } = await import("./setup-skill-V3HDWN7T.js");
1762
+ const { setupSkill } = await import("./setup-skill-CSKNZVG2.js");
1763
1763
  setupSkill({ json: jsonMode, cloud: cli.flags.cloud });
1764
1764
  break;
1765
1765
  }
1766
1766
  case "uninstall": {
1767
- const { uninstallSkill } = await import("./setup-skill-V3HDWN7T.js");
1767
+ const { uninstallSkill } = await import("./setup-skill-CSKNZVG2.js");
1768
1768
  uninstallSkill({ json: jsonMode });
1769
1769
  break;
1770
1770
  }
@@ -107,6 +107,7 @@ async function runReportsList(options) {
107
107
  markdown: [
108
108
  `# Reports (${options.org})`,
109
109
  "",
110
+ `- Total matching filters: ${result.totalCount}`,
110
111
  `- Returned: ${result.reports.length}`,
111
112
  `- Next cursor: ${result.nextCursor ?? "none"}`,
112
113
  "",
@@ -120,7 +121,9 @@ async function runReportsList(options) {
120
121
  console.log("No reports found.");
121
122
  return;
122
123
  }
123
- console.log(`Reports for ${options.org} (returned ${result.reports.length})`);
124
+ console.log(
125
+ `Reports for ${options.org} (returned ${result.reports.length} of ${result.totalCount} matching filters)`
126
+ );
124
127
  for (const row of rows) {
125
128
  const customerTag = row.reportedByCustomer ? " (customer)" : "";
126
129
  console.log(
@@ -6,7 +6,7 @@ import {
6
6
  readInstalledSkillVersion,
7
7
  setupSkill,
8
8
  uninstallSkill
9
- } from "./chunk-LKITFBIG.js";
9
+ } from "./chunk-4RKRCENC.js";
10
10
  import "./chunk-6VTWWGNV.js";
11
11
  export {
12
12
  getBundledSkillContent,
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": "0.23.0",
5
+ "version": "0.24.0",
6
6
  "license": "UNLICENSED",
7
7
  "homepage": "https://chainpatrol.com/docs/cli",
8
8
  "keywords": [