@zksecurity/zkao-sdk 0.16.0-next.11 → 0.18.0-next.13
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 +219 -7
- package/dist/index.js +50 -0
- package/package.json +1 -1
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 about every three days 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. 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
|
+
*/
|
|
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,7 @@ interface paths {
|
|
|
289
317
|
};
|
|
290
318
|
/**
|
|
291
319
|
* Get an advisory
|
|
292
|
-
* @description Requires scope: `read`. The advisory, the software it concerns, 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.
|
|
293
321
|
*
|
|
294
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.
|
|
295
323
|
*
|
|
@@ -314,7 +342,7 @@ interface paths {
|
|
|
314
342
|
get?: never;
|
|
315
343
|
/**
|
|
316
344
|
* Record which versions an advisory affects
|
|
317
|
-
* @description Requires scope: `advisories:write`. Replaces the whole set of affected ranges, so send what is affected now rather than a patch.
|
|
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.
|
|
318
346
|
*
|
|
319
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.
|
|
320
348
|
*
|
|
@@ -727,6 +755,11 @@ interface components {
|
|
|
727
755
|
Scan: {
|
|
728
756
|
id: string;
|
|
729
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;
|
|
730
763
|
repositoryId: string;
|
|
731
764
|
commitHash?: string | null;
|
|
732
765
|
/** @description A diff scan's base, as the merge base SHA its change is measured from. Null for other scans. */
|
|
@@ -807,6 +840,7 @@ interface components {
|
|
|
807
840
|
};
|
|
808
841
|
FindingNote: {
|
|
809
842
|
id: string;
|
|
843
|
+
/** @description Markdown. A page of the app the assistant names is an absolute link. */
|
|
810
844
|
body: string;
|
|
811
845
|
/** Format: date-time */
|
|
812
846
|
createdAt: string;
|
|
@@ -1075,6 +1109,63 @@ interface components {
|
|
|
1075
1109
|
key: string;
|
|
1076
1110
|
deleted: boolean;
|
|
1077
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 schedule's or project's monthly automation cap is reached, `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 configured monthly spending cap. Legacy schedules derive the budget from their cadence and per-run budget. */
|
|
1125
|
+
monthlyBudgetCredits: number | null;
|
|
1126
|
+
/**
|
|
1127
|
+
* @description Legacy fixed cadence. Null for a custom interval or no schedule. Use intervalHours for the actual interval.
|
|
1128
|
+
* @enum {string|null}
|
|
1129
|
+
*/
|
|
1130
|
+
cadence: "daily" | "weekly" | "biweekly" | "monthly" | null;
|
|
1131
|
+
/** @description Hours between scheduled runs. Null when no schedule exists. */
|
|
1132
|
+
intervalHours: number | null;
|
|
1133
|
+
perRunBudgetCredits: number | null;
|
|
1134
|
+
/** @description Audit areas the runs rotate through, one per run, least recently scanned first. Empty means every run scans the whole repository. */
|
|
1135
|
+
areaKeys: string[];
|
|
1136
|
+
/** @description Net credits the schedule's runs spent since the UTC month began. */
|
|
1137
|
+
spentThisMonthCredits: number;
|
|
1138
|
+
/** @description Runs the schedule launched since the UTC month began. */
|
|
1139
|
+
runsThisMonth: number;
|
|
1140
|
+
/** Format: date-time */
|
|
1141
|
+
lastRunAt: string | null;
|
|
1142
|
+
/**
|
|
1143
|
+
* Format: date-time
|
|
1144
|
+
* @description When the next run becomes due. A past time means within the hour. Null when paused or stopped.
|
|
1145
|
+
*/
|
|
1146
|
+
nextRunAt: string | null;
|
|
1147
|
+
/** @description A month that funds a run about every three days at the recommended per-run budget. */
|
|
1148
|
+
recommendedMonthlyCredits: number | null;
|
|
1149
|
+
/** @description A month that funds a weekly run at that budget. Less is refused. */
|
|
1150
|
+
minimumMonthlyCredits: number | null;
|
|
1151
|
+
/** @description The largest monthly budget currently allowed for the repository. Administrators can raise it. */
|
|
1152
|
+
maximumMonthlyCredits: number | null;
|
|
1153
|
+
};
|
|
1154
|
+
SetContinuousTestingRequest: {
|
|
1155
|
+
/** @description False pauses the schedule; true turns it on or resumes it. */
|
|
1156
|
+
enabled?: boolean;
|
|
1157
|
+
/** @description Re-plans the interval and the per-run budget within the returned minimum and maximum. */
|
|
1158
|
+
monthlyBudgetCredits?: number;
|
|
1159
|
+
/** @description Replaces the rotation set. An empty array scans the whole repository every run. */
|
|
1160
|
+
areaKeys?: string[];
|
|
1161
|
+
/** @description The scheduled branch. Defaults to the repository's default branch. */
|
|
1162
|
+
branch?: string;
|
|
1163
|
+
};
|
|
1164
|
+
RemoveContinuousTestingResult: {
|
|
1165
|
+
repositoryId: string;
|
|
1166
|
+
branch: string;
|
|
1167
|
+
removed: boolean;
|
|
1168
|
+
};
|
|
1078
1169
|
CancelScanResult: {
|
|
1079
1170
|
scanId: string;
|
|
1080
1171
|
/** @description Terminal status after cancellation (always CANCELLED). */
|
|
@@ -1124,18 +1215,18 @@ interface components {
|
|
|
1124
1215
|
PublishFindingRequest: {
|
|
1125
1216
|
/** @description A note id on the finding to pin as the published note. */
|
|
1126
1217
|
noteId?: string;
|
|
1127
|
-
/** @description
|
|
1218
|
+
/** @description True generates a new access password. False removes password protection. Omission preserves an existing password. */
|
|
1128
1219
|
withPassword?: boolean;
|
|
1129
1220
|
};
|
|
1130
1221
|
PublishScanRequest: {
|
|
1131
|
-
/** @description
|
|
1222
|
+
/** @description True generates a new access password. False removes password protection. Omission preserves an existing password. */
|
|
1132
1223
|
withPassword?: boolean;
|
|
1133
1224
|
};
|
|
1134
1225
|
PublishArtifactResult: {
|
|
1135
1226
|
artifactId: string;
|
|
1136
1227
|
/** @description Slug in /public/{scans,findings}/<publicId>. */
|
|
1137
1228
|
publicId: string;
|
|
1138
|
-
/** @description The
|
|
1229
|
+
/** @description The artifact's current access password, or null when it has no password. */
|
|
1139
1230
|
accessPassword?: string | null;
|
|
1140
1231
|
};
|
|
1141
1232
|
};
|
|
@@ -1230,6 +1321,8 @@ interface components {
|
|
|
1230
1321
|
/** @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. */
|
|
1231
1322
|
FindingId: string;
|
|
1232
1323
|
RepositoryId: string;
|
|
1324
|
+
/** @description The scheduled branch. Defaults to the repository's default branch. */
|
|
1325
|
+
ContinuousTestingBranch: string;
|
|
1233
1326
|
Page: number;
|
|
1234
1327
|
Limit: number;
|
|
1235
1328
|
};
|
|
@@ -1435,6 +1528,97 @@ interface operations {
|
|
|
1435
1528
|
409: components["responses"]["Conflict"];
|
|
1436
1529
|
};
|
|
1437
1530
|
};
|
|
1531
|
+
getContinuousTesting: {
|
|
1532
|
+
parameters: {
|
|
1533
|
+
query?: {
|
|
1534
|
+
/** @description The scheduled branch. Defaults to the repository's default branch. */
|
|
1535
|
+
branch?: components["parameters"]["ContinuousTestingBranch"];
|
|
1536
|
+
};
|
|
1537
|
+
header?: never;
|
|
1538
|
+
path: {
|
|
1539
|
+
projectId: components["parameters"]["ProjectId"];
|
|
1540
|
+
repositoryId: components["parameters"]["RepositoryId"];
|
|
1541
|
+
};
|
|
1542
|
+
cookie?: never;
|
|
1543
|
+
};
|
|
1544
|
+
requestBody?: never;
|
|
1545
|
+
responses: {
|
|
1546
|
+
/** @description OK */
|
|
1547
|
+
200: {
|
|
1548
|
+
headers: {
|
|
1549
|
+
[name: string]: unknown;
|
|
1550
|
+
};
|
|
1551
|
+
content: {
|
|
1552
|
+
"application/json": components["schemas"]["ContinuousTesting"];
|
|
1553
|
+
};
|
|
1554
|
+
};
|
|
1555
|
+
400: components["responses"]["BadRequest"];
|
|
1556
|
+
401: components["responses"]["Unauthorized"];
|
|
1557
|
+
403: components["responses"]["Forbidden"];
|
|
1558
|
+
404: components["responses"]["NotFound"];
|
|
1559
|
+
};
|
|
1560
|
+
};
|
|
1561
|
+
setContinuousTesting: {
|
|
1562
|
+
parameters: {
|
|
1563
|
+
query?: never;
|
|
1564
|
+
header?: never;
|
|
1565
|
+
path: {
|
|
1566
|
+
projectId: components["parameters"]["ProjectId"];
|
|
1567
|
+
repositoryId: components["parameters"]["RepositoryId"];
|
|
1568
|
+
};
|
|
1569
|
+
cookie?: never;
|
|
1570
|
+
};
|
|
1571
|
+
requestBody: {
|
|
1572
|
+
content: {
|
|
1573
|
+
"application/json": components["schemas"]["SetContinuousTestingRequest"];
|
|
1574
|
+
};
|
|
1575
|
+
};
|
|
1576
|
+
responses: {
|
|
1577
|
+
/** @description OK */
|
|
1578
|
+
200: {
|
|
1579
|
+
headers: {
|
|
1580
|
+
[name: string]: unknown;
|
|
1581
|
+
};
|
|
1582
|
+
content: {
|
|
1583
|
+
"application/json": components["schemas"]["ContinuousTesting"];
|
|
1584
|
+
};
|
|
1585
|
+
};
|
|
1586
|
+
400: components["responses"]["BadRequest"];
|
|
1587
|
+
401: components["responses"]["Unauthorized"];
|
|
1588
|
+
403: components["responses"]["Forbidden"];
|
|
1589
|
+
404: components["responses"]["NotFound"];
|
|
1590
|
+
};
|
|
1591
|
+
};
|
|
1592
|
+
removeContinuousTesting: {
|
|
1593
|
+
parameters: {
|
|
1594
|
+
query?: {
|
|
1595
|
+
/** @description The scheduled branch. Defaults to the repository's default branch. */
|
|
1596
|
+
branch?: components["parameters"]["ContinuousTestingBranch"];
|
|
1597
|
+
};
|
|
1598
|
+
header?: never;
|
|
1599
|
+
path: {
|
|
1600
|
+
projectId: components["parameters"]["ProjectId"];
|
|
1601
|
+
repositoryId: components["parameters"]["RepositoryId"];
|
|
1602
|
+
};
|
|
1603
|
+
cookie?: never;
|
|
1604
|
+
};
|
|
1605
|
+
requestBody?: never;
|
|
1606
|
+
responses: {
|
|
1607
|
+
/** @description OK */
|
|
1608
|
+
200: {
|
|
1609
|
+
headers: {
|
|
1610
|
+
[name: string]: unknown;
|
|
1611
|
+
};
|
|
1612
|
+
content: {
|
|
1613
|
+
"application/json": components["schemas"]["RemoveContinuousTestingResult"];
|
|
1614
|
+
};
|
|
1615
|
+
};
|
|
1616
|
+
400: components["responses"]["BadRequest"];
|
|
1617
|
+
401: components["responses"]["Unauthorized"];
|
|
1618
|
+
403: components["responses"]["Forbidden"];
|
|
1619
|
+
404: components["responses"]["NotFound"];
|
|
1620
|
+
};
|
|
1621
|
+
};
|
|
1438
1622
|
listScans: {
|
|
1439
1623
|
parameters: {
|
|
1440
1624
|
query?: {
|
|
@@ -2249,6 +2433,9 @@ type RepositoryGuidance = Schemas["RepositoryGuidance"];
|
|
|
2249
2433
|
type AuditArea = Schemas["AuditArea"];
|
|
2250
2434
|
type AuditAreaList = Schemas["AuditAreaList"];
|
|
2251
2435
|
type DeleteAuditAreaResult = Schemas["DeleteAuditAreaResult"];
|
|
2436
|
+
type ContinuousTesting = Schemas["ContinuousTesting"];
|
|
2437
|
+
type SetContinuousTestingRequest = Schemas["SetContinuousTestingRequest"];
|
|
2438
|
+
type RemoveContinuousTestingResult = Schemas["RemoveContinuousTestingResult"];
|
|
2252
2439
|
type SetGuidanceResult = Schemas["SetGuidanceResult"];
|
|
2253
2440
|
type TokenInfo = Schemas["TokenInfo"];
|
|
2254
2441
|
type BillingBalance = Schemas["BillingBalance"];
|
|
@@ -2437,6 +2624,31 @@ declare class ZkaoClient {
|
|
|
2437
2624
|
* a scan's map named is refused with a `409`.
|
|
2438
2625
|
*/
|
|
2439
2626
|
deleteAuditArea(repositoryId: string, areaKey: string): Promise<DeleteAuditAreaResult>;
|
|
2627
|
+
/**
|
|
2628
|
+
* Read a repository's Continuous Testing schedule for one branch (requires
|
|
2629
|
+
* the `read` scope). Defaults to the repository's default branch. With no
|
|
2630
|
+
* schedule, `enabled` is false and the budget fields are null; the
|
|
2631
|
+
* recommended and minimum monthly budgets are still returned.
|
|
2632
|
+
*/
|
|
2633
|
+
getContinuousTesting(repositoryId: string, opts?: {
|
|
2634
|
+
branch?: string;
|
|
2635
|
+
}): Promise<ContinuousTesting>;
|
|
2636
|
+
/**
|
|
2637
|
+
* Turn Continuous Testing on or off, set its monthly budget, or choose the
|
|
2638
|
+
* audit areas it rotates through (requires the `automations:write` scope).
|
|
2639
|
+
* Every field is optional. Turning it on with no schedule creates one at
|
|
2640
|
+
* the recommended monthly budget, funding a run about every three days. The
|
|
2641
|
+
* budget sets the interval from weekly to twice daily. A budget outside the
|
|
2642
|
+
* returned minimum and maximum is refused with a `400`.
|
|
2643
|
+
*/
|
|
2644
|
+
setContinuousTesting(repositoryId: string, body: SetContinuousTestingRequest): Promise<ContinuousTesting>;
|
|
2645
|
+
/**
|
|
2646
|
+
* Remove a repository's Continuous Testing schedule for one branch
|
|
2647
|
+
* (requires the `automations:write` scope). Scans it already ran are kept.
|
|
2648
|
+
*/
|
|
2649
|
+
removeContinuousTesting(repositoryId: string, opts?: {
|
|
2650
|
+
branch?: string;
|
|
2651
|
+
}): Promise<RemoveContinuousTestingResult>;
|
|
2440
2652
|
listScans(opts?: {
|
|
2441
2653
|
page?: number;
|
|
2442
2654
|
limit?: number;
|
|
@@ -2635,4 +2847,4 @@ declare class ZkaoClient {
|
|
|
2635
2847
|
}): Promise<UsageMonthSummary[]>;
|
|
2636
2848
|
}
|
|
2637
2849
|
|
|
2638
|
-
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, DEFAULT_BASE_URL, type Finding, type FindingDetail, type FindingNote, type LaunchScanRequest, type LaunchScanResult, type ManualAuditRequest, type ManualAuditResult, type Paginated, type PublishArtifactResult, type Report, type ReportStatus, 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 };
|
|
2850
|
+
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, funding a run about every three days. The
|
|
314
|
+
* budget sets the interval from weekly to twice daily. A budget outside the
|
|
315
|
+
* returned minimum and maximum 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", {
|