@zksecurity/zkao-sdk 0.20.0-next.15 → 0.25.0-next.17

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
@@ -145,18 +145,18 @@ interface paths {
145
145
  cookie?: never;
146
146
  };
147
147
  /**
148
- * Get a repository's Continuous Testing schedule
149
- * @description Requires scope: `read`. Continuous Testing scans one branch on a schedule paid from a monthly budget. With no schedule on the branch, `enabled` is false and the schedule fields are null. The recommended monthly budget funds a run about every three days at the repository's recommended per-run budget; the minimum funds a run every week at it.
148
+ * Get a repository's Continuous Security schedule
149
+ * @description Requires scope: `read`. Continuous Security scans one branch on a schedule paid from a monthly budget. With no schedule on the branch, `enabled` is false and the schedule fields are null. The recommended monthly budget supports ongoing analysis. The minimum funds one useful analysis step. Scheduling adapts to the available allocation.
150
150
  */
151
151
  get: operations["getContinuousTesting"];
152
152
  /**
153
- * Turn Continuous Testing on, change it, or pause it
153
+ * Turn Continuous Security on, change it, or pause it
154
154
  * @description Requires scope: `automations:write`. Every field is optional. With no schedule on the branch, the request creates one at the recommended monthly budget unless `monthlyBudgetCredits` is given; `enabled: false` then changes nothing. The budget sets the interval smoothly from once a week to twice a day. The recommended budget funds a run about every three days. A budget outside the returned minimum and maximum is refused with `400`. Administrators can raise the maximum monthly budget. `areaKeys` replaces the audit areas runs rotate through, one per run. `enabled: false` pauses the schedule and keeps it. A change re-arms a schedule that had stopped. Each run still needs spendable credits when it launches.
155
155
  */
156
156
  put: operations["setContinuousTesting"];
157
157
  post?: never;
158
158
  /**
159
- * Remove a repository's Continuous Testing schedule
159
+ * Remove a repository's Continuous Security schedule
160
160
  * @description Requires scope: `automations:write`. Scans the schedule already ran stay. Responds `404` when the branch has no schedule.
161
161
  */
162
162
  delete: operations["removeContinuousTesting"];
@@ -165,6 +165,32 @@ interface paths {
165
165
  patch?: never;
166
166
  trace?: never;
167
167
  };
168
+ "/projects/{projectId}/repositories/{repositoryId}/reports": {
169
+ parameters: {
170
+ query?: never;
171
+ header?: never;
172
+ path?: never;
173
+ cookie?: never;
174
+ };
175
+ get?: never;
176
+ put?: never;
177
+ /**
178
+ * File a vulnerability report against a repository
179
+ * @description Requires scope: `reports:write`. Files a report into the programme that takes reports for this repository, as prose. It arrives exactly as a GitHub private vulnerability report does and is read and split into claims by the same step, so nothing downstream distinguishes them.
180
+ *
181
+ * Returns with `intakeState: PENDING`. `investigateReport` refuses a report until that reaches `COMPLETE`, so poll `/projects/{projectId}/reports` before asking for an investigation.
182
+ *
183
+ * Idempotent on content: the same title and body against the same repository name the same report, so a retried call returns the original with `200` rather than filing a second copy.
184
+ *
185
+ * Free. The reading that follows is charged to the project, and the investigation is charged when someone asks for it.
186
+ */
187
+ post: operations["submitReport"];
188
+ delete?: never;
189
+ options?: never;
190
+ head?: never;
191
+ patch?: never;
192
+ trace?: never;
193
+ };
168
194
  "/projects/{projectId}/scans": {
169
195
  parameters: {
170
196
  query?: never;
@@ -196,6 +222,16 @@ interface paths {
196
222
  * it. A malformed, unknown, or misplaced base is a `400` with code
197
223
  * `diff_base_required`, `diff_base_not_allowed`, or `diff_base_invalid`.
198
224
  * A diff scan also needs a change to audit (otherwise `422`).
225
+ *
226
+ * The builtin presets come in two tiers. Flash runs fewer techniques on
227
+ * a flash model. Max runs every technique on flagship models. Each tier
228
+ * has a preset for the code (`builtin:Flash`, `builtin:Max`), a change
229
+ * (`builtin:Flash Diff`, `builtin:Max Diff`), open findings
230
+ * (`builtin:Flash Retriage`, `builtin:Max Retriage`) and resolved
231
+ * findings (`builtin:Flash Regression Check`,
232
+ * `builtin:Max Regression Check`). Earlier names, such as
233
+ * `builtin:Rapid Review`, `builtin:Deep Audit` and `builtin:Diff Scan`,
234
+ * still resolve.
199
235
  */
200
236
  post: operations["launchScan"];
201
237
  delete?: never;
@@ -528,6 +564,8 @@ interface paths {
528
564
  /**
529
565
  * Change a finding's resolution status
530
566
  * @description Requires scope: `findings:write`.
567
+ *
568
+ * On a finding triage dismissed (`triageStatus` `FALSE_POSITIVE`), any status other than `FALSE_POSITIVE` or `DUPLICATE` reopens it: its `triageStatus` becomes `CONFIRMED` and the override fields record who did it. `NOT_STARTED` reopens it even when that is already its resolution. Setting `FALSE_POSITIVE` on a reopened finding undoes the reopen: the triage verdict comes back, the override is cleared, and the resolution returns to `NOT_STARTED`. The response carries the stored statuses.
531
569
  */
532
570
  patch: operations["updateFindingResolution"];
533
571
  trace?: never;
@@ -837,6 +875,14 @@ interface components {
837
875
  confirmationEvidence?: "POC" | "ANALYSIS" | null;
838
876
  resolutionStatus: components["schemas"]["ResolutionStatus"];
839
877
  notesCount: number;
878
+ /** @description Why triage dismissed the finding as a false positive. Null when triage did not dismiss it or gave no reason. */
879
+ dismissalReason: string | null;
880
+ /** @description The triage verdict a member replaced, kept from the first override. Null when nobody overrode triage. */
881
+ triageOverriddenFrom: components["schemas"]["TriageStatus"] | null;
882
+ /** Format: date-time */
883
+ triageOverriddenAt: string | null;
884
+ /** @description Name, or email when there is no name, of the member who overrode triage. */
885
+ triageOverriddenByName: string | null;
840
886
  };
841
887
  FindingNote: {
842
888
  id: string;
@@ -1024,7 +1070,7 @@ interface components {
1024
1070
  };
1025
1071
  LaunchScanRequest: {
1026
1072
  repositoryId: string;
1027
- /** @description Max budget for the scan, in credits. Reserved at launch. Omit it to launch at the budget zkao recommends for this scan type and scope on this repository. That is the last such scan's budget, or half again when that scan ran short of it, never above twice the scan type's minimum. A first scan starts at twice the minimum. */
1073
+ /** @description Max budget for the scan, in credits. Reserved at launch. Omit it to launch at the budget zkao recommends for this scan type and scope on this repository. That is the last such scan's budget, or half again when that scan ran short of it, never above twice the scan type's minimum. A first scan starts at twice the minimum. A diff scan is sized from its change instead: the minimum for up to 500 changed lines, then in proportion, up to three times the minimum. */
1028
1074
  creditBudget?: number;
1029
1075
  /** @description A preset ref from /scan-presets. Defaults to the first active preset. */
1030
1076
  presetRef?: string;
@@ -1035,10 +1081,21 @@ interface components {
1035
1081
  commitMessage?: string | null;
1036
1082
  /** @description What a diff scan's change is measured from: a commit SHA, branch, or tag. Required by a diff scan preset and refused by every other. The scan records the merge base of this and the scanned commit. */
1037
1083
  baseCommit?: string | null;
1084
+ /** @description Options for Recheck open findings. Omit to reassess eligible Not started findings on the selected branch. Fresh rechecks require the branch's latest commit and reject a pinned commit or audit scope. */
1085
+ backlogRecheck?: {
1086
+ /** @description Also include In progress findings. Defaults to false. */
1087
+ includeInProgress?: boolean;
1088
+ /** @description Restrict the recheck to these findings. Eligibility is still checked against the selected repository and branch. Omit to include all eligible findings. Cannot be combined with resumeScanId. */
1089
+ findingIds?: string[];
1090
+ /** @description Continue a finished recheck's unassessed findings on the same repository. Uses that scan's branch, commit, and status selection. */
1091
+ resumeScanId?: string;
1092
+ };
1038
1093
  /** @description Where this launch came from, shown on the scan page. Optional, and display only: nothing in the pipeline reads it. */
1039
1094
  trigger?: components["schemas"]["ScanTrigger"] | null;
1040
1095
  /** @description Area keys from /audit-areas to scope this scan to. Omit or send an empty array to scan the whole repository. A key the repository's current map no longer names fails the launch rather than being dropped, so a scan budgeted for one subsystem never silently runs against everything. */
1041
1096
  auditAreaKeys?: string[];
1097
+ /** @description The code to audit, described in your own words, instead of `auditAreaKeys`. Send one or the other, not both. */
1098
+ auditScope?: string | null;
1042
1099
  /** @description Guidance for this scan only, replacing the repository's configured guidance layer (it is still layered over any committed zkao.md). Omit the field to inherit the repository's guidance; send null to scan with no guidance layer. */
1043
1100
  guidance?: string | null;
1044
1101
  };
@@ -1111,7 +1168,7 @@ interface components {
1111
1168
  };
1112
1169
  ContinuousTesting: {
1113
1170
  repositoryId: string;
1114
- /** @description False when Continuous Testing is not offered. */
1171
+ /** @description False when Continuous Security is not offered. */
1115
1172
  available: boolean;
1116
1173
  /** @description False when there is no schedule or it is paused. */
1117
1174
  enabled: boolean;
@@ -1144,9 +1201,9 @@ interface components {
1144
1201
  * @description When the next run becomes due. A past time means within the hour. Null when paused or stopped.
1145
1202
  */
1146
1203
  nextRunAt: string | null;
1147
- /** @description A month that funds a run about every three days at the recommended per-run budget. */
1204
+ /** @description A suggested allocation for ongoing work, based on the repository's estimated analysis budget. */
1148
1205
  recommendedMonthlyCredits: number | null;
1149
- /** @description A month that funds a weekly run at that budget. Less is refused. */
1206
+ /** @description The smallest month that funds one analysis step. Less is refused. */
1150
1207
  minimumMonthlyCredits: number | null;
1151
1208
  /** @description The largest monthly budget currently allowed for the repository. Administrators can raise it. */
1152
1209
  maximumMonthlyCredits: number | null;
@@ -1180,6 +1237,29 @@ interface components {
1180
1237
  /** @description Claims queued for triage, or null when an investigation was already running and this call started nothing. */
1181
1238
  claimsQueued: number | null;
1182
1239
  };
1240
+ SubmitReportRequest: {
1241
+ /** @description One line naming the flaw. */
1242
+ title: string;
1243
+ /** @description What the flaw is, how to reach it, and what it costs. Prose: this is read and split into claims, so write it for a reader rather than as fields. Anything past the limit would be stored and never read. */
1244
+ body: string;
1245
+ /**
1246
+ * @description What the reporter claims, which is not an assessment. It decides how closely the report is read, so an inflated claim costs the programme more.
1247
+ * @enum {string|null}
1248
+ */
1249
+ claimedSeverity?: "CRITICAL" | "HIGH" | "MEDIUM" | "LOW" | "INFO" | null;
1250
+ /** @description Who found it, all self-asserted. Used for attribution on the advisory, never for authorization. */
1251
+ reporter?: {
1252
+ name?: string | null;
1253
+ email?: string | null;
1254
+ githubLogin?: string | null;
1255
+ };
1256
+ };
1257
+ SubmitReportResult: {
1258
+ /** @description The identifier `investigateReport` takes. */
1259
+ publicId: string;
1260
+ /** @description Always PENDING here. The report is queued to be read and split into claims, and an investigation waits for COMPLETE. */
1261
+ intakeState: string;
1262
+ };
1183
1263
  /** @description Optionally attach or reuse a note alongside a resolution change. */
1184
1264
  ChangeNote: {
1185
1265
  /** @description Create a new note with this body. */
@@ -1203,6 +1283,8 @@ interface components {
1203
1283
  FindingResolutionResult: {
1204
1284
  findingId: string;
1205
1285
  resolutionStatus: components["schemas"]["ResolutionStatus"];
1286
+ /** @description The triage status after the change. It moves when the change reopens a finding triage dismissed, or undoes that reopen. */
1287
+ triageStatus: components["schemas"]["TriageStatus"];
1206
1288
  };
1207
1289
  /**
1208
1290
  * @description Short code for why a finding is being closed, chosen from the set offered for the `resolutionStatus` it is sent with; a code belonging to a different status is rejected with 400. Ignored for the open statuses (`NOT_STARTED`, `IN_PROGRESS`) and when `note` is also given. It is not stored as a field: it is recorded as a comment on the finding stating what was chosen, which is returned by the notes endpoints.
@@ -1619,6 +1701,48 @@ interface operations {
1619
1701
  404: components["responses"]["NotFound"];
1620
1702
  };
1621
1703
  };
1704
+ submitReport: {
1705
+ parameters: {
1706
+ query?: never;
1707
+ header?: never;
1708
+ path: {
1709
+ projectId: components["parameters"]["ProjectId"];
1710
+ repositoryId: components["parameters"]["RepositoryId"];
1711
+ };
1712
+ cookie?: never;
1713
+ };
1714
+ requestBody: {
1715
+ content: {
1716
+ "application/json": components["schemas"]["SubmitReportRequest"];
1717
+ };
1718
+ };
1719
+ responses: {
1720
+ /** @description Already filed, by an identical earlier call */
1721
+ 200: {
1722
+ headers: {
1723
+ [name: string]: unknown;
1724
+ };
1725
+ content: {
1726
+ "application/json": components["schemas"]["SubmitReportResult"];
1727
+ };
1728
+ };
1729
+ /** @description Filed */
1730
+ 201: {
1731
+ headers: {
1732
+ [name: string]: unknown;
1733
+ };
1734
+ content: {
1735
+ "application/json": components["schemas"]["SubmitReportResult"];
1736
+ };
1737
+ };
1738
+ 400: components["responses"]["BadRequest"];
1739
+ 401: components["responses"]["Unauthorized"];
1740
+ 403: components["responses"]["Forbidden"];
1741
+ 404: components["responses"]["NotFound"];
1742
+ 409: components["responses"]["Conflict"];
1743
+ 429: components["responses"]["RateLimited"];
1744
+ };
1745
+ };
1622
1746
  listScans: {
1623
1747
  parameters: {
1624
1748
  query?: {
@@ -2445,6 +2569,8 @@ type UsageEventType = Schemas["UsageEventType"];
2445
2569
  type BillingSummary = Schemas["BillingSummary"];
2446
2570
  type InvestigateReportResult = Schemas["InvestigateReportResult"];
2447
2571
  type Report = Schemas["Report"];
2572
+ type SubmitReportRequest = Schemas["SubmitReportRequest"];
2573
+ type SubmitReportResult = Schemas["SubmitReportResult"];
2448
2574
  /** The triage statuses a report moves through. */
2449
2575
  type ReportStatus = "NEW" | "TRIAGING" | "NEEDS_INFO" | "ACCEPTED" | "DUPLICATE" | "REJECTED";
2450
2576
  type Advisory = Schemas["Advisory"];
@@ -2744,6 +2870,21 @@ declare class ZkaoClient {
2744
2870
  * confirmation mail is sent from the app.
2745
2871
  */
2746
2872
  addAdvisoryContact(contact: AdvisoryContactInput): Promise<AdvisoryContact>;
2873
+ /**
2874
+ * File a vulnerability report against one of the programme's repositories.
2875
+ *
2876
+ * Requires the `reports:write` scope. Send prose: this is read and split
2877
+ * into claims for you, so write it for a reader rather than as fields.
2878
+ *
2879
+ * Comes back with `intakeState: "PENDING"`, because the reading is queued.
2880
+ * {@link investigateReport} refuses the report until that reaches
2881
+ * `COMPLETE`, so poll {@link listReports} before asking for one.
2882
+ *
2883
+ * Idempotent on content: the same title and body against the same
2884
+ * repository name the same report, so a retry after a timeout returns the
2885
+ * original rather than filing a second copy.
2886
+ */
2887
+ submitReport(repositoryId: string, report: SubmitReportRequest): Promise<SubmitReportResult>;
2747
2888
  /**
2748
2889
  * Reports the programme has received, newest first.
2749
2890
  *
package/dist/index.js CHANGED
@@ -529,6 +529,30 @@ var ZkaoClient = class {
529
529
  return unwrap(res).contact;
530
530
  }
531
531
  // --- Incoming reports ---------------------------------------------------
532
+ /**
533
+ * File a vulnerability report against one of the programme's repositories.
534
+ *
535
+ * Requires the `reports:write` scope. Send prose: this is read and split
536
+ * into claims for you, so write it for a reader rather than as fields.
537
+ *
538
+ * Comes back with `intakeState: "PENDING"`, because the reading is queued.
539
+ * {@link investigateReport} refuses the report until that reaches
540
+ * `COMPLETE`, so poll {@link listReports} before asking for one.
541
+ *
542
+ * Idempotent on content: the same title and body against the same
543
+ * repository name the same report, so a retry after a timeout returns the
544
+ * original rather than filing a second copy.
545
+ */
546
+ async submitReport(repositoryId, report) {
547
+ const res = await this.http.POST(
548
+ "/projects/{projectId}/repositories/{repositoryId}/reports",
549
+ {
550
+ params: { path: { ...this.path, repositoryId } },
551
+ body: report
552
+ }
553
+ );
554
+ return unwrap(res);
555
+ }
532
556
  /**
533
557
  * Reports the programme has received, newest first.
534
558
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zksecurity/zkao-sdk",
3
- "version": "0.20.0-next.15",
3
+ "version": "0.25.0-next.17",
4
4
  "description": "TypeScript SDK for the zkao Project API",
5
5
  "license": "MIT",
6
6
  "author": "zkSecurity",