@zksecurity/zkao-sdk 0.25.0-next.16 → 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
@@ -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;
@@ -1211,6 +1237,29 @@ interface components {
1211
1237
  /** @description Claims queued for triage, or null when an investigation was already running and this call started nothing. */
1212
1238
  claimsQueued: number | null;
1213
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
+ };
1214
1263
  /** @description Optionally attach or reuse a note alongside a resolution change. */
1215
1264
  ChangeNote: {
1216
1265
  /** @description Create a new note with this body. */
@@ -1652,6 +1701,48 @@ interface operations {
1652
1701
  404: components["responses"]["NotFound"];
1653
1702
  };
1654
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
+ };
1655
1746
  listScans: {
1656
1747
  parameters: {
1657
1748
  query?: {
@@ -2478,6 +2569,8 @@ type UsageEventType = Schemas["UsageEventType"];
2478
2569
  type BillingSummary = Schemas["BillingSummary"];
2479
2570
  type InvestigateReportResult = Schemas["InvestigateReportResult"];
2480
2571
  type Report = Schemas["Report"];
2572
+ type SubmitReportRequest = Schemas["SubmitReportRequest"];
2573
+ type SubmitReportResult = Schemas["SubmitReportResult"];
2481
2574
  /** The triage statuses a report moves through. */
2482
2575
  type ReportStatus = "NEW" | "TRIAGING" | "NEEDS_INFO" | "ACCEPTED" | "DUPLICATE" | "REJECTED";
2483
2576
  type Advisory = Schemas["Advisory"];
@@ -2777,6 +2870,21 @@ declare class ZkaoClient {
2777
2870
  * confirmation mail is sent from the app.
2778
2871
  */
2779
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>;
2780
2888
  /**
2781
2889
  * Reports the programme has received, newest first.
2782
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.25.0-next.16",
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",