@zksecurity/zkao-sdk 0.15.0-next.10 → 0.17.0-next.12

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
@@ -137,6 +137,34 @@ interface paths {
137
137
  patch?: never;
138
138
  trace?: never;
139
139
  };
140
+ "/projects/{projectId}/repositories/{repositoryId}/continuous-testing": {
141
+ parameters: {
142
+ query?: never;
143
+ header?: never;
144
+ path?: never;
145
+ cookie?: never;
146
+ };
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 every day at the repository's recommended per-run budget; the minimum funds a run every week at it.
150
+ */
151
+ get: operations["getContinuousTesting"];
152
+ /**
153
+ * Turn Continuous Testing on, change it, or pause it
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. A monthly budget at or above the recommended one runs every day, one at or above the minimum runs once a week with larger runs, and one below the minimum is refused with `400`. `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
+ */
156
+ put: operations["setContinuousTesting"];
157
+ post?: never;
158
+ /**
159
+ * Remove a repository's Continuous Testing schedule
160
+ * @description Requires scope: `automations:write`. Scans the schedule already ran stay. Responds `404` when the branch has no schedule.
161
+ */
162
+ delete: operations["removeContinuousTesting"];
163
+ options?: never;
164
+ head?: never;
165
+ patch?: never;
166
+ trace?: never;
167
+ };
140
168
  "/projects/{projectId}/scans": {
141
169
  parameters: {
142
170
  query?: never;
@@ -269,7 +297,7 @@ interface paths {
269
297
  };
270
298
  /**
271
299
  * List advisories
272
- * @description Requires scope: `read`. The project's coordinated-disclosure advisories, newest first. Optionally filter by `status`.
300
+ * @description Requires scope: `read`. The project's coordinated-disclosure advisories, newest first. Optionally filter by `status`. A repository-restricted token sees an advisory only when every associated repository is in its allowlist.
273
301
  */
274
302
  get: operations["listAdvisories"];
275
303
  put?: never;
@@ -289,7 +317,9 @@ interface paths {
289
317
  };
290
318
  /**
291
319
  * Get an advisory
292
- * @description Requires scope: `read`. The advisory, the versions it affects, and the notices planned for it.
320
+ * @description Requires scope: `read`. The advisory, the software it concerns, the versions it affects, and the notices planned for it. Every associated repository must be in the token's allowlist.
321
+ *
322
+ * `software` is what decides the audience: a contact is notified about an advisory only when they run some of it. `affected` is a separate statement about versions, and is often empty.
293
323
  *
294
324
  * A notice the plan is holding back carries `blockedReason`. The commonest one is that no affected range names a fixed version, which only the people who shipped the release can supply; record it in the app and the notice becomes schedulable.
295
325
  */
@@ -302,6 +332,66 @@ interface paths {
302
332
  patch?: never;
303
333
  trace?: never;
304
334
  };
335
+ "/projects/{projectId}/advisories/{publicId}/affected": {
336
+ parameters: {
337
+ query?: never;
338
+ header?: never;
339
+ path?: never;
340
+ cookie?: never;
341
+ };
342
+ get?: never;
343
+ /**
344
+ * Record which versions an advisory affects
345
+ * @description Requires scope: `advisories:write`. Replaces the whole set of affected ranges, so send what is affected now rather than a patch. Every existing and requested repository must be in the token's allowlist. This check also applies to an empty replacement.
346
+ *
347
+ * `fixedIn` is the point of this endpoint. A patch notice stays blocked until some range names a fixed version, and only the people who shipped the release know it.
348
+ *
349
+ * Versions only. A range may name only software already on the advisory's `software`, and anything else is a `400`. Which software an advisory concerns decides who hears about it, and that is its own statement, made in the app: a call about versions does not change it in either direction.
350
+ *
351
+ * This call never sends anything. It records versions and recomputes the disclosure plan: a notice blocked for want of a fix becomes eligible to go, and one that loses its fix is blocked again, dropping any approval it was carrying so nobody approves wording a later fix rewrites. When an eligible notice is actually sent is governed by the programme's own settings, not by this call.
352
+ */
353
+ put: operations["replaceAdvisoryAffected"];
354
+ post?: never;
355
+ delete?: never;
356
+ options?: never;
357
+ head?: never;
358
+ patch?: never;
359
+ trace?: never;
360
+ };
361
+ "/projects/{projectId}/advisory-contacts": {
362
+ parameters: {
363
+ query?: never;
364
+ header?: never;
365
+ path?: never;
366
+ cookie?: never;
367
+ };
368
+ /**
369
+ * List the advisory contacts
370
+ * @description Requires scope: `contacts:read`. The programme's contact list, oldest first, which is the order to read it in when reconciling against a record kept elsewhere.
371
+ *
372
+ * Its own scope, not `read`: this list is other people's work addresses and the record of who learns about a vulnerability before the public does, so a routine pipeline token does not reach it.
373
+ *
374
+ * `software` on each row is what notices are matched on. A project with no security programme reads as an empty list.
375
+ */
376
+ get: operations["listAdvisoryContacts"];
377
+ put?: never;
378
+ /**
379
+ * Add an advisory contact
380
+ * @description Requires scope: `contacts:write`. Puts one address on the programme's contact list.
381
+ *
382
+ * `software` says which of the project's repositories this contact runs, and is required. It is what every notice is matched on: a contact who runs nothing is told nothing.
383
+ *
384
+ * The contact starts `PENDING_VERIFICATION`, and an unconfirmed address receives nothing embargoed. The confirmation mail is sent from the app, not by this call, so nothing is emailed to the address you send here.
385
+ *
386
+ * There is no endpoint that reads the contact list back. It is other people's work addresses and the record of who hears about a vulnerability early.
387
+ */
388
+ post: operations["addAdvisoryContact"];
389
+ delete?: never;
390
+ options?: never;
391
+ head?: never;
392
+ patch?: never;
393
+ trace?: never;
394
+ };
305
395
  "/projects/{projectId}/findings": {
306
396
  parameters: {
307
397
  query?: never;
@@ -665,6 +755,11 @@ interface components {
665
755
  Scan: {
666
756
  id: string;
667
757
  status: components["schemas"]["ScanStatus"];
758
+ /**
759
+ * @description An actionable setup failure for a failed scan. Null for other statuses and internal failures. Restore a project member's GitHub access or approve the App permissions before launching again.
760
+ * @enum {string|null}
761
+ */
762
+ failureCode?: "NO_MEMBER_REPO_ACCESS" | "GITHUB_APP_PERMISSIONS_PENDING" | null;
668
763
  repositoryId: string;
669
764
  commitHash?: string | null;
670
765
  /** @description A diff scan's base, as the merge base SHA its change is measured from. Null for other scans. */
@@ -745,6 +840,7 @@ interface components {
745
840
  };
746
841
  FindingNote: {
747
842
  id: string;
843
+ /** @description Markdown. A page of the app the assistant names is an absolute link. */
748
844
  body: string;
749
845
  /** Format: date-time */
750
846
  createdAt: string;
@@ -868,9 +964,35 @@ interface components {
868
964
  description: string;
869
965
  impact: string;
870
966
  cwe?: string | null;
967
+ /** @description The software the advisory is about. A contact hears about it only when they run some of it. */
968
+ software: {
969
+ owner: string;
970
+ name: string;
971
+ }[];
871
972
  affected: components["schemas"]["AdvisoryAffected"][];
872
973
  notices: components["schemas"]["AdvisoryNotice"][];
873
974
  };
975
+ AdvisoryContact: {
976
+ id: string;
977
+ email: string;
978
+ organization: string;
979
+ tier: string;
980
+ /** @description `PENDING_VERIFICATION` until the contact confirms the address. An unconfirmed address receives nothing embargoed. */
981
+ status: string;
982
+ /** @description The software this contact runs, which notices are matched on. */
983
+ software: {
984
+ owner: string;
985
+ name: string;
986
+ }[];
987
+ /** Format: date-time */
988
+ createdAt: string;
989
+ };
990
+ PaginatedAdvisoryContacts: {
991
+ items: components["schemas"]["AdvisoryContact"][];
992
+ page: number;
993
+ limit: number;
994
+ total: number;
995
+ };
874
996
  PaginatedAdvisories: {
875
997
  items: components["schemas"]["Advisory"][];
876
998
  page: number;
@@ -987,6 +1109,59 @@ interface components {
987
1109
  key: string;
988
1110
  deleted: boolean;
989
1111
  };
1112
+ ContinuousTesting: {
1113
+ repositoryId: string;
1114
+ /** @description False when Continuous Testing is not offered. */
1115
+ available: boolean;
1116
+ /** @description False when there is no schedule or it is paused. */
1117
+ enabled: boolean;
1118
+ /**
1119
+ * @description Why an enabled schedule is not running: `budget_reached` when the project's monthly automation cap is spent, `error` after repeated failures. Null with no schedule.
1120
+ * @enum {string|null}
1121
+ */
1122
+ state: "active" | "converged" | "budget_reached" | "error" | null;
1123
+ branch: string;
1124
+ /** @description The per-run budget times the runs the cadence fits in a month. */
1125
+ monthlyBudgetCredits: number | null;
1126
+ /**
1127
+ * @description New and re-planned schedules are daily or weekly. Older schedules may be biweekly or monthly until their budget changes.
1128
+ * @enum {string|null}
1129
+ */
1130
+ cadence: "daily" | "weekly" | "biweekly" | "monthly" | null;
1131
+ perRunBudgetCredits: number | null;
1132
+ /** @description Audit areas the runs rotate through, one per run, least recently scanned first. Empty means every run scans the whole repository. */
1133
+ areaKeys: string[];
1134
+ /** @description Net credits the schedule's runs spent since the UTC month began. */
1135
+ spentThisMonthCredits: number;
1136
+ /** @description Runs the schedule launched since the UTC month began. */
1137
+ runsThisMonth: number;
1138
+ /** Format: date-time */
1139
+ lastRunAt: string | null;
1140
+ /**
1141
+ * Format: date-time
1142
+ * @description When the next run becomes due. A past time means within the hour. Null when paused or stopped.
1143
+ */
1144
+ nextRunAt: string | null;
1145
+ /** @description A month that funds a daily run at the recommended per-run budget. */
1146
+ recommendedMonthlyCredits: number | null;
1147
+ /** @description A month that funds a weekly run at that budget. Less is refused. */
1148
+ minimumMonthlyCredits: number | null;
1149
+ };
1150
+ SetContinuousTestingRequest: {
1151
+ /** @description False pauses the schedule; true turns it on or resumes it. */
1152
+ enabled?: boolean;
1153
+ /** @description Re-plans the cadence and the per-run budget. */
1154
+ monthlyBudgetCredits?: number;
1155
+ /** @description Replaces the rotation set. An empty array scans the whole repository every run. */
1156
+ areaKeys?: string[];
1157
+ /** @description The scheduled branch. Defaults to the repository's default branch. */
1158
+ branch?: string;
1159
+ };
1160
+ RemoveContinuousTestingResult: {
1161
+ repositoryId: string;
1162
+ branch: string;
1163
+ removed: boolean;
1164
+ };
990
1165
  CancelScanResult: {
991
1166
  scanId: string;
992
1167
  /** @description Terminal status after cancellation (always CANCELLED). */
@@ -1036,18 +1211,18 @@ interface components {
1036
1211
  PublishFindingRequest: {
1037
1212
  /** @description A note id on the finding to pin as the published note. */
1038
1213
  noteId?: string;
1039
- /** @description Generate a password to gate access to the public artifact. */
1214
+ /** @description True generates a new access password. False removes password protection. Omission preserves an existing password. */
1040
1215
  withPassword?: boolean;
1041
1216
  };
1042
1217
  PublishScanRequest: {
1043
- /** @description Generate a password to gate access to the public artifact. */
1218
+ /** @description True generates a new access password. False removes password protection. Omission preserves an existing password. */
1044
1219
  withPassword?: boolean;
1045
1220
  };
1046
1221
  PublishArtifactResult: {
1047
1222
  artifactId: string;
1048
1223
  /** @description Slug in /public/{scans,findings}/<publicId>. */
1049
1224
  publicId: string;
1050
- /** @description The generated access password when withPassword was requested; otherwise null. */
1225
+ /** @description The artifact's current access password, or null when it has no password. */
1051
1226
  accessPassword?: string | null;
1052
1227
  };
1053
1228
  };
@@ -1142,6 +1317,8 @@ interface components {
1142
1317
  /** @description The finding id, or the `ZK-` label shown on the finding page (the id's last eight characters, prefix optional). A label that matches more than one finding in the project is refused with `409 conflict`; use the full id. */
1143
1318
  FindingId: string;
1144
1319
  RepositoryId: string;
1320
+ /** @description The scheduled branch. Defaults to the repository's default branch. */
1321
+ ContinuousTestingBranch: string;
1145
1322
  Page: number;
1146
1323
  Limit: number;
1147
1324
  };
@@ -1347,6 +1524,97 @@ interface operations {
1347
1524
  409: components["responses"]["Conflict"];
1348
1525
  };
1349
1526
  };
1527
+ getContinuousTesting: {
1528
+ parameters: {
1529
+ query?: {
1530
+ /** @description The scheduled branch. Defaults to the repository's default branch. */
1531
+ branch?: components["parameters"]["ContinuousTestingBranch"];
1532
+ };
1533
+ header?: never;
1534
+ path: {
1535
+ projectId: components["parameters"]["ProjectId"];
1536
+ repositoryId: components["parameters"]["RepositoryId"];
1537
+ };
1538
+ cookie?: never;
1539
+ };
1540
+ requestBody?: never;
1541
+ responses: {
1542
+ /** @description OK */
1543
+ 200: {
1544
+ headers: {
1545
+ [name: string]: unknown;
1546
+ };
1547
+ content: {
1548
+ "application/json": components["schemas"]["ContinuousTesting"];
1549
+ };
1550
+ };
1551
+ 400: components["responses"]["BadRequest"];
1552
+ 401: components["responses"]["Unauthorized"];
1553
+ 403: components["responses"]["Forbidden"];
1554
+ 404: components["responses"]["NotFound"];
1555
+ };
1556
+ };
1557
+ setContinuousTesting: {
1558
+ parameters: {
1559
+ query?: never;
1560
+ header?: never;
1561
+ path: {
1562
+ projectId: components["parameters"]["ProjectId"];
1563
+ repositoryId: components["parameters"]["RepositoryId"];
1564
+ };
1565
+ cookie?: never;
1566
+ };
1567
+ requestBody: {
1568
+ content: {
1569
+ "application/json": components["schemas"]["SetContinuousTestingRequest"];
1570
+ };
1571
+ };
1572
+ responses: {
1573
+ /** @description OK */
1574
+ 200: {
1575
+ headers: {
1576
+ [name: string]: unknown;
1577
+ };
1578
+ content: {
1579
+ "application/json": components["schemas"]["ContinuousTesting"];
1580
+ };
1581
+ };
1582
+ 400: components["responses"]["BadRequest"];
1583
+ 401: components["responses"]["Unauthorized"];
1584
+ 403: components["responses"]["Forbidden"];
1585
+ 404: components["responses"]["NotFound"];
1586
+ };
1587
+ };
1588
+ removeContinuousTesting: {
1589
+ parameters: {
1590
+ query?: {
1591
+ /** @description The scheduled branch. Defaults to the repository's default branch. */
1592
+ branch?: components["parameters"]["ContinuousTestingBranch"];
1593
+ };
1594
+ header?: never;
1595
+ path: {
1596
+ projectId: components["parameters"]["ProjectId"];
1597
+ repositoryId: components["parameters"]["RepositoryId"];
1598
+ };
1599
+ cookie?: never;
1600
+ };
1601
+ requestBody?: never;
1602
+ responses: {
1603
+ /** @description OK */
1604
+ 200: {
1605
+ headers: {
1606
+ [name: string]: unknown;
1607
+ };
1608
+ content: {
1609
+ "application/json": components["schemas"]["RemoveContinuousTestingResult"];
1610
+ };
1611
+ };
1612
+ 400: components["responses"]["BadRequest"];
1613
+ 401: components["responses"]["Unauthorized"];
1614
+ 403: components["responses"]["Forbidden"];
1615
+ 404: components["responses"]["NotFound"];
1616
+ };
1617
+ };
1350
1618
  listScans: {
1351
1619
  parameters: {
1352
1620
  query?: {
@@ -1589,6 +1857,141 @@ interface operations {
1589
1857
  404: components["responses"]["NotFound"];
1590
1858
  };
1591
1859
  };
1860
+ replaceAdvisoryAffected: {
1861
+ parameters: {
1862
+ query?: never;
1863
+ header?: never;
1864
+ path: {
1865
+ projectId: components["parameters"]["ProjectId"];
1866
+ /** @description The advisory's readable identifier. */
1867
+ publicId: string;
1868
+ };
1869
+ cookie?: never;
1870
+ };
1871
+ requestBody: {
1872
+ content: {
1873
+ "application/json": {
1874
+ affected: {
1875
+ repository: {
1876
+ owner: string;
1877
+ name: string;
1878
+ };
1879
+ /** @description First version carrying the defect. */
1880
+ introducedIn: string;
1881
+ /** @description Version that closes the range, or null. */
1882
+ fixedIn?: string | null;
1883
+ }[];
1884
+ };
1885
+ };
1886
+ };
1887
+ responses: {
1888
+ /** @description OK */
1889
+ 200: {
1890
+ headers: {
1891
+ [name: string]: unknown;
1892
+ };
1893
+ content: {
1894
+ "application/json": {
1895
+ advisory: components["schemas"]["AdvisoryDetail"];
1896
+ };
1897
+ };
1898
+ };
1899
+ 400: components["responses"]["BadRequest"];
1900
+ 401: components["responses"]["Unauthorized"];
1901
+ 403: components["responses"]["Forbidden"];
1902
+ 404: components["responses"]["NotFound"];
1903
+ 409: components["responses"]["Conflict"];
1904
+ };
1905
+ };
1906
+ listAdvisoryContacts: {
1907
+ parameters: {
1908
+ query?: {
1909
+ page?: components["parameters"]["Page"];
1910
+ limit?: components["parameters"]["Limit"];
1911
+ tier?: "EMBARGO" | "DOWNSTREAM" | "ANNOUNCE";
1912
+ status?: "ACTIVE" | "PENDING_VERIFICATION" | "BOUNCED" | "UNSUBSCRIBED";
1913
+ };
1914
+ header?: never;
1915
+ path: {
1916
+ projectId: components["parameters"]["ProjectId"];
1917
+ };
1918
+ cookie?: never;
1919
+ };
1920
+ requestBody?: never;
1921
+ responses: {
1922
+ /** @description OK */
1923
+ 200: {
1924
+ headers: {
1925
+ [name: string]: unknown;
1926
+ };
1927
+ content: {
1928
+ "application/json": components["schemas"]["PaginatedAdvisoryContacts"];
1929
+ };
1930
+ };
1931
+ 400: components["responses"]["BadRequest"];
1932
+ 401: components["responses"]["Unauthorized"];
1933
+ 403: components["responses"]["Forbidden"];
1934
+ };
1935
+ };
1936
+ addAdvisoryContact: {
1937
+ parameters: {
1938
+ query?: never;
1939
+ header?: never;
1940
+ path: {
1941
+ projectId: components["parameters"]["ProjectId"];
1942
+ };
1943
+ cookie?: never;
1944
+ };
1945
+ requestBody: {
1946
+ content: {
1947
+ "application/json": {
1948
+ email: string;
1949
+ /** @description The organisation this contact speaks for. */
1950
+ organization: string;
1951
+ /**
1952
+ * @description How early this contact is told. `EMBARGO` hears first and alone, `DOWNSTREAM` joins once a patch exists, `ANNOUNCE` learns at public disclosure.
1953
+ * @enum {string}
1954
+ */
1955
+ tier: "EMBARGO" | "DOWNSTREAM" | "ANNOUNCE";
1956
+ /** @description The repositories this contact runs. At least one. */
1957
+ software: {
1958
+ owner: string;
1959
+ name: string;
1960
+ }[];
1961
+ name?: string | null;
1962
+ title?: string | null;
1963
+ notes?: string | null;
1964
+ tags?: string[];
1965
+ };
1966
+ };
1967
+ };
1968
+ responses: {
1969
+ /** @description Created */
1970
+ 201: {
1971
+ headers: {
1972
+ [name: string]: unknown;
1973
+ };
1974
+ content: {
1975
+ "application/json": {
1976
+ contact: components["schemas"]["AdvisoryContact"];
1977
+ };
1978
+ };
1979
+ };
1980
+ 400: components["responses"]["BadRequest"];
1981
+ 401: components["responses"]["Unauthorized"];
1982
+ 403: components["responses"]["Forbidden"];
1983
+ 404: components["responses"]["NotFound"];
1984
+ /** @description That address is already on the programme's contact list. */
1985
+ 409: {
1986
+ headers: {
1987
+ [name: string]: unknown;
1988
+ };
1989
+ content: {
1990
+ "application/json": components["schemas"]["Error"];
1991
+ };
1992
+ };
1993
+ };
1994
+ };
1592
1995
  listFindings: {
1593
1996
  parameters: {
1594
1997
  query?: {
@@ -2026,6 +2429,9 @@ type RepositoryGuidance = Schemas["RepositoryGuidance"];
2026
2429
  type AuditArea = Schemas["AuditArea"];
2027
2430
  type AuditAreaList = Schemas["AuditAreaList"];
2028
2431
  type DeleteAuditAreaResult = Schemas["DeleteAuditAreaResult"];
2432
+ type ContinuousTesting = Schemas["ContinuousTesting"];
2433
+ type SetContinuousTestingRequest = Schemas["SetContinuousTestingRequest"];
2434
+ type RemoveContinuousTestingResult = Schemas["RemoveContinuousTestingResult"];
2029
2435
  type SetGuidanceResult = Schemas["SetGuidanceResult"];
2030
2436
  type TokenInfo = Schemas["TokenInfo"];
2031
2437
  type BillingBalance = Schemas["BillingBalance"];
@@ -2039,6 +2445,37 @@ type Report = Schemas["Report"];
2039
2445
  type ReportStatus = "NEW" | "TRIAGING" | "NEEDS_INFO" | "ACCEPTED" | "DUPLICATE" | "REJECTED";
2040
2446
  type Advisory = Schemas["Advisory"];
2041
2447
  type AdvisoryDetail = Schemas["AdvisoryDetail"];
2448
+ type AdvisoryAffected = Schemas["AdvisoryAffected"];
2449
+ /** One affected version line, as a caller states it. */
2450
+ type AdvisoryAffectedInput = {
2451
+ repository: {
2452
+ owner: string;
2453
+ name: string;
2454
+ };
2455
+ introducedIn: string;
2456
+ fixedIn?: string | null;
2457
+ };
2458
+ type AdvisoryNotice = Schemas["AdvisoryNotice"];
2459
+ type AdvisoryContact = Schemas["AdvisoryContact"];
2460
+ /** How early a contact is told. */
2461
+ type ContactTier = "EMBARGO" | "DOWNSTREAM" | "ANNOUNCE";
2462
+ /** Whether a contact can be written to. Only ACTIVE hears anything. */
2463
+ type ContactStatus = "ACTIVE" | "PENDING_VERIFICATION" | "BOUNCED" | "UNSUBSCRIBED";
2464
+ /** A contact as a caller states it. */
2465
+ type AdvisoryContactInput = {
2466
+ email: string;
2467
+ organization: string;
2468
+ tier: ContactTier;
2469
+ /** The repositories this contact runs. At least one. */
2470
+ software: {
2471
+ owner: string;
2472
+ name: string;
2473
+ }[];
2474
+ name?: string | null;
2475
+ title?: string | null;
2476
+ notes?: string | null;
2477
+ tags?: string[];
2478
+ };
2042
2479
  /** The statuses an advisory moves through. */
2043
2480
  type AdvisoryStatus = "DRAFT" | "SCHEDULED" | "UNDER_EMBARGO" | "PUBLISHED" | "WITHDRAWN";
2044
2481
  type UsageMonthSummary = Schemas["UsageMonthSummary"];
@@ -2183,6 +2620,31 @@ declare class ZkaoClient {
2183
2620
  * a scan's map named is refused with a `409`.
2184
2621
  */
2185
2622
  deleteAuditArea(repositoryId: string, areaKey: string): Promise<DeleteAuditAreaResult>;
2623
+ /**
2624
+ * Read a repository's Continuous Testing schedule for one branch (requires
2625
+ * the `read` scope). Defaults to the repository's default branch. With no
2626
+ * schedule, `enabled` is false and the budget fields are null; the
2627
+ * recommended and minimum monthly budgets are still returned.
2628
+ */
2629
+ getContinuousTesting(repositoryId: string, opts?: {
2630
+ branch?: string;
2631
+ }): Promise<ContinuousTesting>;
2632
+ /**
2633
+ * Turn Continuous Testing on or off, set its monthly budget, or choose the
2634
+ * audit areas it rotates through (requires the `automations:write` scope).
2635
+ * Every field is optional. Turning it on with no schedule creates one at
2636
+ * the recommended monthly budget. zkao picks the cadence from the budget: a
2637
+ * daily run when it covers one, otherwise weekly. A budget below the weekly
2638
+ * minimum is refused with a `400`.
2639
+ */
2640
+ setContinuousTesting(repositoryId: string, body: SetContinuousTestingRequest): Promise<ContinuousTesting>;
2641
+ /**
2642
+ * Remove a repository's Continuous Testing schedule for one branch
2643
+ * (requires the `automations:write` scope). Scans it already ran are kept.
2644
+ */
2645
+ removeContinuousTesting(repositoryId: string, opts?: {
2646
+ branch?: string;
2647
+ }): Promise<RemoveContinuousTestingResult>;
2186
2648
  listScans(opts?: {
2187
2649
  page?: number;
2188
2650
  limit?: number;
@@ -2222,13 +2684,62 @@ declare class ZkaoClient {
2222
2684
  status?: AdvisoryStatus;
2223
2685
  }): Promise<Paginated<Advisory>>;
2224
2686
  /**
2225
- * One advisory, the versions it affects, and the notices planned for it.
2687
+ * One advisory, the software it concerns, the versions it affects, and the
2688
+ * notices planned for it.
2689
+ *
2690
+ * `software` is what decides the audience: a contact is notified about an
2691
+ * advisory only when they run some of it. `affected` is a separate statement
2692
+ * about versions, and is often empty.
2226
2693
  *
2227
2694
  * A notice the plan is holding back carries `blockedReason`. The commonest
2228
2695
  * one is that no affected range names a fixed version, which only the people
2229
2696
  * who shipped the release can supply.
2230
2697
  */
2231
2698
  getAdvisory(publicId: string): Promise<AdvisoryDetail>;
2699
+ /**
2700
+ * Record which versions this advisory affects.
2701
+ *
2702
+ * Replaces the whole set, so send what is affected now rather than a patch.
2703
+ * `fixedIn` is the point: a patch notice stays blocked until some range
2704
+ * names a fixed version, and only the people who shipped the release know
2705
+ * it.
2706
+ *
2707
+ * Versions only. A range may name only software already on the advisory's
2708
+ * `software`, and anything else is a 400: which software an advisory
2709
+ * concerns decides who hears about it, and that is its own statement made
2710
+ * in the app.
2711
+ *
2712
+ * This call never sends anything. It records versions and recomputes the
2713
+ * plan; when an eligible notice is actually sent is the programme's
2714
+ * business.
2715
+ */
2716
+ replaceAdvisoryAffected(publicId: string, affected: AdvisoryAffectedInput[]): Promise<AdvisoryDetail>;
2717
+ /**
2718
+ * The programme's advisory contacts, oldest first.
2719
+ *
2720
+ * Needs `contacts:read`, which is held apart from `read`: this list is other
2721
+ * people's work addresses and the record of who learns about a vulnerability
2722
+ * before the public does. `software` on each row is what notices are matched
2723
+ * on. A project with no security programme reads as an empty list.
2724
+ */
2725
+ listAdvisoryContacts(opts?: {
2726
+ page?: number;
2727
+ limit?: number;
2728
+ tier?: ContactTier;
2729
+ status?: ContactStatus;
2730
+ }): Promise<Paginated<AdvisoryContact>>;
2731
+ /**
2732
+ * Put one address on the programme's advisory contact list.
2733
+ *
2734
+ * `software` says which of the project's repositories this contact runs, and
2735
+ * is required: it is what every notice is matched on, so a contact who runs
2736
+ * nothing is told nothing.
2737
+ *
2738
+ * The contact starts `PENDING_VERIFICATION`, and an unconfirmed address
2739
+ * receives nothing embargoed. Nothing is emailed by this call: the
2740
+ * confirmation mail is sent from the app.
2741
+ */
2742
+ addAdvisoryContact(contact: AdvisoryContactInput): Promise<AdvisoryContact>;
2232
2743
  /**
2233
2744
  * Reports the programme has received, newest first.
2234
2745
  *
@@ -2332,4 +2843,4 @@ declare class ZkaoClient {
2332
2843
  }): Promise<UsageMonthSummary[]>;
2333
2844
  }
2334
2845
 
2335
- export { type BillingBalance, type BillingSummary, type BillingUsage, type CancelScanResult, type ChangeNote, DEFAULT_BASE_URL, type Finding, type FindingDetail, type FindingNote, type LaunchScanRequest, type LaunchScanResult, type ManualAuditRequest, type ManualAuditResult, type Paginated, type PublishArtifactResult, type Repository, type RepositoryGuidance, type ResolutionReason, type ResolutionStatus, type Scan, type ScanDetail, type ScanPreset, type ScanStatus, type SetGuidanceResult, type Severity, TERMINAL_SCAN_STATUSES, type TokenInfo, type TriageStatus, type UsageEvent, type UsageEventType, type UsageMonthSummary, type WaitForRepositoryReadyOptions, type WaitForScanOptions, ZkaoApiError, ZkaoClient, type ZkaoClientOptions, type components, getTokenInfo, isTerminalScanStatus, normalizeBaseUrl, type paths, resolveBaseUrlFromEnv };
2846
+ export { type Advisory, type AdvisoryAffected, type AdvisoryAffectedInput, type AdvisoryContact, type AdvisoryContactInput, type AdvisoryDetail, type AdvisoryNotice, type AdvisoryStatus, type BillingBalance, type BillingSummary, type BillingUsage, type CancelScanResult, type ChangeNote, type ContactStatus, type ContactTier, type ContinuousTesting, DEFAULT_BASE_URL, type Finding, type FindingDetail, type FindingNote, type LaunchScanRequest, type LaunchScanResult, type ManualAuditRequest, type ManualAuditResult, type Paginated, type PublishArtifactResult, type RemoveContinuousTestingResult, type Report, type ReportStatus, type Repository, type RepositoryGuidance, type ResolutionReason, type ResolutionStatus, type Scan, type ScanDetail, type ScanPreset, type ScanStatus, type SetContinuousTestingRequest, type SetGuidanceResult, type Severity, TERMINAL_SCAN_STATUSES, type TokenInfo, type TriageStatus, type UsageEvent, type UsageEventType, type UsageMonthSummary, type WaitForRepositoryReadyOptions, type WaitForScanOptions, ZkaoApiError, ZkaoClient, type ZkaoClientOptions, type components, getTokenInfo, isTerminalScanStatus, normalizeBaseUrl, type paths, resolveBaseUrlFromEnv };
package/dist/index.js CHANGED
@@ -287,6 +287,56 @@ var ZkaoClient = class {
287
287
  );
288
288
  return unwrap(res);
289
289
  }
290
+ // --- Continuous Testing -------------------------------------------------
291
+ /**
292
+ * Read a repository's Continuous Testing schedule for one branch (requires
293
+ * the `read` scope). Defaults to the repository's default branch. With no
294
+ * schedule, `enabled` is false and the budget fields are null; the
295
+ * recommended and minimum monthly budgets are still returned.
296
+ */
297
+ async getContinuousTesting(repositoryId, opts = {}) {
298
+ const res = await this.http.GET(
299
+ "/projects/{projectId}/repositories/{repositoryId}/continuous-testing",
300
+ {
301
+ params: {
302
+ path: { ...this.path, repositoryId },
303
+ query: opts.branch === void 0 ? {} : { branch: opts.branch }
304
+ }
305
+ }
306
+ );
307
+ return unwrap(res);
308
+ }
309
+ /**
310
+ * Turn Continuous Testing on or off, set its monthly budget, or choose the
311
+ * audit areas it rotates through (requires the `automations:write` scope).
312
+ * Every field is optional. Turning it on with no schedule creates one at
313
+ * the recommended monthly budget. zkao picks the cadence from the budget: a
314
+ * daily run when it covers one, otherwise weekly. A budget below the weekly
315
+ * minimum is refused with a `400`.
316
+ */
317
+ async setContinuousTesting(repositoryId, body) {
318
+ const res = await this.http.PUT(
319
+ "/projects/{projectId}/repositories/{repositoryId}/continuous-testing",
320
+ { params: { path: { ...this.path, repositoryId } }, body }
321
+ );
322
+ return unwrap(res);
323
+ }
324
+ /**
325
+ * Remove a repository's Continuous Testing schedule for one branch
326
+ * (requires the `automations:write` scope). Scans it already ran are kept.
327
+ */
328
+ async removeContinuousTesting(repositoryId, opts = {}) {
329
+ const res = await this.http.DELETE(
330
+ "/projects/{projectId}/repositories/{repositoryId}/continuous-testing",
331
+ {
332
+ params: {
333
+ path: { ...this.path, repositoryId },
334
+ query: opts.branch === void 0 ? {} : { branch: opts.branch }
335
+ }
336
+ }
337
+ );
338
+ return unwrap(res);
339
+ }
290
340
  // --- Scans --------------------------------------------------------------
291
341
  async listScans(opts = {}) {
292
342
  const res = await this.http.GET("/projects/{projectId}/scans", {
@@ -390,7 +440,12 @@ var ZkaoClient = class {
390
440
  return unwrap(res);
391
441
  }
392
442
  /**
393
- * One advisory, the versions it affects, and the notices planned for it.
443
+ * One advisory, the software it concerns, the versions it affects, and the
444
+ * notices planned for it.
445
+ *
446
+ * `software` is what decides the audience: a contact is notified about an
447
+ * advisory only when they run some of it. `affected` is a separate statement
448
+ * about versions, and is often empty.
394
449
  *
395
450
  * A notice the plan is holding back carries `blockedReason`. The commonest
396
451
  * one is that no affected range names a fixed version, which only the people
@@ -403,6 +458,76 @@ var ZkaoClient = class {
403
458
  );
404
459
  return unwrap(res).advisory;
405
460
  }
461
+ /**
462
+ * Record which versions this advisory affects.
463
+ *
464
+ * Replaces the whole set, so send what is affected now rather than a patch.
465
+ * `fixedIn` is the point: a patch notice stays blocked until some range
466
+ * names a fixed version, and only the people who shipped the release know
467
+ * it.
468
+ *
469
+ * Versions only. A range may name only software already on the advisory's
470
+ * `software`, and anything else is a 400: which software an advisory
471
+ * concerns decides who hears about it, and that is its own statement made
472
+ * in the app.
473
+ *
474
+ * This call never sends anything. It records versions and recomputes the
475
+ * plan; when an eligible notice is actually sent is the programme's
476
+ * business.
477
+ */
478
+ async replaceAdvisoryAffected(publicId, affected) {
479
+ const res = await this.http.PUT(
480
+ "/projects/{projectId}/advisories/{publicId}/affected",
481
+ {
482
+ params: { path: { ...this.path, publicId } },
483
+ body: { affected }
484
+ }
485
+ );
486
+ return unwrap(res).advisory;
487
+ }
488
+ /**
489
+ * The programme's advisory contacts, oldest first.
490
+ *
491
+ * Needs `contacts:read`, which is held apart from `read`: this list is other
492
+ * people's work addresses and the record of who learns about a vulnerability
493
+ * before the public does. `software` on each row is what notices are matched
494
+ * on. A project with no security programme reads as an empty list.
495
+ */
496
+ async listAdvisoryContacts(opts = {}) {
497
+ const res = await this.http.GET(
498
+ "/projects/{projectId}/advisory-contacts",
499
+ {
500
+ params: {
501
+ path: this.path,
502
+ query: {
503
+ page: opts.page,
504
+ limit: opts.limit,
505
+ tier: opts.tier,
506
+ status: opts.status
507
+ }
508
+ }
509
+ }
510
+ );
511
+ return unwrap(res);
512
+ }
513
+ /**
514
+ * Put one address on the programme's advisory contact list.
515
+ *
516
+ * `software` says which of the project's repositories this contact runs, and
517
+ * is required: it is what every notice is matched on, so a contact who runs
518
+ * nothing is told nothing.
519
+ *
520
+ * The contact starts `PENDING_VERIFICATION`, and an unconfirmed address
521
+ * receives nothing embargoed. Nothing is emailed by this call: the
522
+ * confirmation mail is sent from the app.
523
+ */
524
+ async addAdvisoryContact(contact) {
525
+ const res = await this.http.POST("/projects/{projectId}/advisory-contacts", {
526
+ params: { path: this.path },
527
+ body: contact
528
+ });
529
+ return unwrap(res).contact;
530
+ }
406
531
  // --- Incoming reports ---------------------------------------------------
407
532
  /**
408
533
  * Reports the programme has received, newest first.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zksecurity/zkao-sdk",
3
- "version": "0.15.0-next.10",
3
+ "version": "0.17.0-next.12",
4
4
  "description": "TypeScript SDK for the zkao Project API",
5
5
  "license": "MIT",
6
6
  "author": "zkSecurity",