@zksecurity/zkao-cli 0.11.1-next.4 → 0.12.0-next.6

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.
Files changed (2) hide show
  1. package/dist/index.js +24 -0
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -828,6 +828,30 @@ var findings = program.command("findings").description("Read and triage findings
828
828
  findings.command("list").option("--scan <id>", "only findings for this scan").option("--page <n>", "page number", toInt).option("--limit <n>", "page size (max 100)", toInt).action(
829
829
  (opts) => run((c) => c.listFindings({ scanId: opts.scan, page: opts.page, limit: opts.limit }))
830
830
  );
831
+ findings.command("details").description(
832
+ "Full detail of a scan's findings or of a set of findings, every page unless --page is given"
833
+ ).option("--scan <id>", "only findings for this scan").option("--ids <ids>", "comma-separated finding ids or ZK- labels, at most 50").option("--page <n>", "fetch only this page", toInt).option("--limit <n>", "page size (max 50)", toInt).action(
834
+ (opts) => run(async (c) => {
835
+ const query = {
836
+ scanId: opts.scan,
837
+ ids: opts.ids?.split(",").map((id) => id.trim()).filter(Boolean),
838
+ limit: opts.limit
839
+ };
840
+ if (opts.page !== void 0) {
841
+ return c.listFindingDetails({ ...query, page: opts.page });
842
+ }
843
+ const first = await c.listFindingDetails({ ...query, page: 1 });
844
+ const items = [...first.items];
845
+ for (let page = 2; items.length < first.total; page++) {
846
+ const next = await c.listFindingDetails({ ...query, page });
847
+ if (next.items.length === 0) {
848
+ break;
849
+ }
850
+ items.push(...next.items);
851
+ }
852
+ return { items, total: first.total, missing: first.missing };
853
+ })
854
+ );
831
855
  findings.command("get <findingId>").description("Get a finding's full detail").action((findingId) => run((c) => c.getFinding(findingId)));
832
856
  findings.command("comment <findingId> <text>").description("Add a comment to a finding").action((findingId, text) => run((c) => c.addFindingNote(findingId, text)));
833
857
  findings.command("severity <findingId> <level>").description("Override severity (CRITICAL|HIGH|MEDIUM|LOW|INFO, or 'none' to clear)").action((findingId, level) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zksecurity/zkao-cli",
3
- "version": "0.11.1-next.4",
3
+ "version": "0.12.0-next.6",
4
4
  "description": "Command-line interface for the zkao Project API",
5
5
  "license": "MIT",
6
6
  "author": "zkSecurity",
@@ -39,7 +39,7 @@
39
39
  "prepublishOnly": "node -e \"if (!(process.env.npm_config_user_agent || '').includes('bun/')) { console.error('Publish with bun publish: npm ships the literal workspace:* dependency and breaks installs.'); process.exit(1); }\""
40
40
  },
41
41
  "dependencies": {
42
- "@zksecurity/zkao-sdk": "0.11.1-next.4",
42
+ "@zksecurity/zkao-sdk": "0.12.0-next.6",
43
43
  "commander": "^12.1.0"
44
44
  },
45
45
  "devDependencies": {