@zksecurity/zkao-sdk 0.11.0-next.3 → 0.12.0-next.5

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/dist/index.d.ts CHANGED
@@ -167,8 +167,7 @@ interface paths {
167
167
  * scanned commit, and requires `baseCommit`. Every other preset refuses
168
168
  * it. A malformed, unknown, or misplaced base is a `400` with code
169
169
  * `diff_base_required`, `diff_base_not_allowed`, or `diff_base_invalid`.
170
- * A diff scan also needs an earlier full scan of the branch, and a
171
- * change to audit (otherwise `422`).
170
+ * A diff scan also needs a change to audit (otherwise `422`).
172
171
  */
173
172
  post: operations["launchScan"];
174
173
  delete?: never;
@@ -237,6 +236,26 @@ interface paths {
237
236
  patch?: never;
238
237
  trace?: never;
239
238
  };
239
+ "/projects/{projectId}/findings/details": {
240
+ parameters: {
241
+ query?: never;
242
+ header?: never;
243
+ path?: never;
244
+ cookie?: never;
245
+ };
246
+ /**
247
+ * Get many findings (full detail)
248
+ * @description Requires scope: `read`. The full detail of a scan's findings, of a set of findings, or both, in one call. Returns the findings shown in the app: confirmed or inconclusive, on scans the project can see.
249
+ */
250
+ get: operations["listFindingDetails"];
251
+ put?: never;
252
+ post?: never;
253
+ delete?: never;
254
+ options?: never;
255
+ head?: never;
256
+ patch?: never;
257
+ trace?: never;
258
+ };
240
259
  "/projects/{projectId}/findings/{findingId}": {
241
260
  parameters: {
242
261
  query?: never;
@@ -529,7 +548,7 @@ interface components {
529
548
  Error: {
530
549
  error: {
531
550
  /** @enum {string} */
532
- code: "unauthorized" | "forbidden" | "not_found" | "bad_request" | "conflict" | "insufficient_credits" | "repository_initializing" | "diff_base_required" | "diff_base_not_allowed" | "diff_base_invalid" | "diff_empty" | "diff_overview_missing" | "rate_limited" | "internal";
551
+ code: "unauthorized" | "forbidden" | "not_found" | "bad_request" | "conflict" | "insufficient_credits" | "repository_initializing" | "diff_base_required" | "diff_base_not_allowed" | "diff_base_invalid" | "diff_empty" | "rate_limited" | "internal";
533
552
  message: string;
534
553
  };
535
554
  };
@@ -625,6 +644,9 @@ interface components {
625
644
  };
626
645
  FindingDetail: components["schemas"]["Finding"] & {
627
646
  description: string;
647
+ impact: string;
648
+ recommendation: string;
649
+ assumptions: string[];
628
650
  pocReport?: string | null;
629
651
  recommendedFix?: string | null;
630
652
  scanId: string;
@@ -650,6 +672,14 @@ interface components {
650
672
  limit: number;
651
673
  total: number;
652
674
  };
675
+ PaginatedFindingDetails: {
676
+ items: components["schemas"]["FindingDetail"][];
677
+ page: number;
678
+ limit: number;
679
+ total: number;
680
+ /** @description The requested `ids` that matched no finding. */
681
+ missing: string[];
682
+ };
653
683
  ScanPreset: {
654
684
  /** @description Pass as `presetRef` when launching. */
655
685
  ref: string;
@@ -838,7 +868,7 @@ interface components {
838
868
  "application/json": components["schemas"]["Error"];
839
869
  };
840
870
  };
841
- /** @description The diff scan cannot run on this repository yet. Code `diff_empty`: the base and the scanned commit have no change between them. Code `diff_overview_missing`: no earlier full scan of the branch (or the default branch) exists to compare against. Run a full scan first. */
871
+ /** @description The diff scan has nothing to audit. Code `diff_empty`: the base and the scanned commit have no change between them. */
842
872
  DiffUnavailable: {
843
873
  headers: {
844
874
  [name: string]: unknown;
@@ -1248,6 +1278,39 @@ interface operations {
1248
1278
  404: components["responses"]["NotFound"];
1249
1279
  };
1250
1280
  };
1281
+ listFindingDetails: {
1282
+ parameters: {
1283
+ query?: {
1284
+ page?: components["parameters"]["Page"];
1285
+ limit?: number;
1286
+ /** @description Only findings belonging to this scan. */
1287
+ scanId?: string;
1288
+ /** @description Comma-separated finding ids or `ZK-` labels, at most 50. Ids that match nothing are listed in `missing`. */
1289
+ ids?: string;
1290
+ };
1291
+ header?: never;
1292
+ path: {
1293
+ projectId: components["parameters"]["ProjectId"];
1294
+ };
1295
+ cookie?: never;
1296
+ };
1297
+ requestBody?: never;
1298
+ responses: {
1299
+ /** @description OK */
1300
+ 200: {
1301
+ headers: {
1302
+ [name: string]: unknown;
1303
+ };
1304
+ content: {
1305
+ "application/json": components["schemas"]["PaginatedFindingDetails"];
1306
+ };
1307
+ };
1308
+ 400: components["responses"]["BadRequest"];
1309
+ 401: components["responses"]["Unauthorized"];
1310
+ 403: components["responses"]["Forbidden"];
1311
+ 404: components["responses"]["NotFound"];
1312
+ };
1313
+ };
1251
1314
  getFinding: {
1252
1315
  parameters: {
1253
1316
  query?: never;
@@ -1605,6 +1668,7 @@ type Scan = Schemas["Scan"];
1605
1668
  type ScanDetail = Schemas["ScanDetail"];
1606
1669
  type Finding = Schemas["Finding"];
1607
1670
  type FindingDetail = Schemas["FindingDetail"];
1671
+ type FindingDetailsPage = Schemas["PaginatedFindingDetails"];
1608
1672
  type FindingNote = Schemas["FindingNote"];
1609
1673
  type ScanPreset = Schemas["ScanPreset"];
1610
1674
  type LaunchScanRequest = Schemas["LaunchScanRequest"];
@@ -1805,6 +1869,17 @@ declare class ZkaoClient {
1805
1869
  limit?: number;
1806
1870
  scanId?: string;
1807
1871
  }): Promise<Paginated<Finding>>;
1872
+ /**
1873
+ * Full detail of many findings in one call: a scan's, a set of ids or `ZK-`
1874
+ * labels (at most 50), or both. Returns the findings shown in the app.
1875
+ * Requested ids that matched nothing come back in `missing`.
1876
+ */
1877
+ listFindingDetails(opts?: {
1878
+ page?: number;
1879
+ limit?: number;
1880
+ scanId?: string;
1881
+ ids?: string[];
1882
+ }): Promise<FindingDetailsPage>;
1808
1883
  getFinding(findingId: string): Promise<FindingDetail>;
1809
1884
  addFindingNote(findingId: string, content: string): Promise<{
1810
1885
  noteId: string;
package/dist/index.js CHANGED
@@ -386,6 +386,25 @@ var ZkaoClient = class {
386
386
  });
387
387
  return unwrap(res);
388
388
  }
389
+ /**
390
+ * Full detail of many findings in one call: a scan's, a set of ids or `ZK-`
391
+ * labels (at most 50), or both. Returns the findings shown in the app.
392
+ * Requested ids that matched nothing come back in `missing`.
393
+ */
394
+ async listFindingDetails(opts = {}) {
395
+ const res = await this.http.GET("/projects/{projectId}/findings/details", {
396
+ params: {
397
+ path: this.path,
398
+ query: {
399
+ page: opts.page,
400
+ limit: opts.limit,
401
+ scanId: opts.scanId,
402
+ ids: opts.ids?.join(",")
403
+ }
404
+ }
405
+ });
406
+ return unwrap(res);
407
+ }
389
408
  async getFinding(findingId) {
390
409
  const res = await this.http.GET("/projects/{projectId}/findings/{findingId}", {
391
410
  params: { path: { ...this.path, findingId } }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zksecurity/zkao-sdk",
3
- "version": "0.11.0-next.3",
3
+ "version": "0.12.0-next.5",
4
4
  "description": "TypeScript SDK for the zkao Project API",
5
5
  "license": "MIT",
6
6
  "author": "zkSecurity",