@zksecurity/zkao-sdk 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.
package/dist/index.d.ts CHANGED
@@ -236,6 +236,26 @@ interface paths {
236
236
  patch?: never;
237
237
  trace?: never;
238
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
+ };
239
259
  "/projects/{projectId}/findings/{findingId}": {
240
260
  parameters: {
241
261
  query?: never;
@@ -624,6 +644,9 @@ interface components {
624
644
  };
625
645
  FindingDetail: components["schemas"]["Finding"] & {
626
646
  description: string;
647
+ impact: string;
648
+ recommendation: string;
649
+ assumptions: string[];
627
650
  pocReport?: string | null;
628
651
  recommendedFix?: string | null;
629
652
  scanId: string;
@@ -649,6 +672,14 @@ interface components {
649
672
  limit: number;
650
673
  total: number;
651
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
+ };
652
683
  ScanPreset: {
653
684
  /** @description Pass as `presetRef` when launching. */
654
685
  ref: string;
@@ -1247,6 +1278,39 @@ interface operations {
1247
1278
  404: components["responses"]["NotFound"];
1248
1279
  };
1249
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
+ };
1250
1314
  getFinding: {
1251
1315
  parameters: {
1252
1316
  query?: never;
@@ -1604,6 +1668,7 @@ type Scan = Schemas["Scan"];
1604
1668
  type ScanDetail = Schemas["ScanDetail"];
1605
1669
  type Finding = Schemas["Finding"];
1606
1670
  type FindingDetail = Schemas["FindingDetail"];
1671
+ type FindingDetailsPage = Schemas["PaginatedFindingDetails"];
1607
1672
  type FindingNote = Schemas["FindingNote"];
1608
1673
  type ScanPreset = Schemas["ScanPreset"];
1609
1674
  type LaunchScanRequest = Schemas["LaunchScanRequest"];
@@ -1804,6 +1869,17 @@ declare class ZkaoClient {
1804
1869
  limit?: number;
1805
1870
  scanId?: string;
1806
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>;
1807
1883
  getFinding(findingId: string): Promise<FindingDetail>;
1808
1884
  addFindingNote(findingId: string, content: string): Promise<{
1809
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.1-next.4",
3
+ "version": "0.12.0-next.6",
4
4
  "description": "TypeScript SDK for the zkao Project API",
5
5
  "license": "MIT",
6
6
  "author": "zkSecurity",