azure-devops-extension-api 4.264.0 → 4.266.0
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/AdvancedSecurity.Reporting/Reporting.d.ts +156 -0
- package/AdvancedSecurity.Reporting/Reporting.js +53 -0
- package/AdvancedSecurity.Reporting/Reporting.min.js +1 -1
- package/AdvancedSecurity.Reporting/ReportingClient.d.ts +13 -2
- package/AdvancedSecurity.Reporting/ReportingClient.js +45 -3
- package/AdvancedSecurity.Reporting/ReportingClient.min.js +1 -1
- package/Alert/Alert.d.ts +47 -0
- package/Alert/Alert.js +14 -0
- package/Alert/Alert.min.js +1 -1
- package/Alert/AlertClient.d.ts +24 -0
- package/Alert/AlertClient.js +68 -0
- package/Alert/AlertClient.min.js +1 -1
- package/Management/Management.d.ts +34 -2
- package/Test/Test.d.ts +127 -6
- package/Test/Test.js +56 -3
- package/Test/Test.min.js +1 -1
- package/TestPlan/TestPlan.d.ts +49 -0
- package/TestResults/TestResultsClient.d.ts +20 -7
- package/TestResults/TestResultsClient.js +52 -10
- package/TestResults/TestResultsClient.min.js +1 -1
- package/Work/Work.d.ts +1 -0
- package/_manifest/spdx_2.2/ESRPClientLogs0126185807986.json +1 -0
- package/_manifest/spdx_2.2/bsi.cose +0 -0
- package/_manifest/spdx_2.2/bsi.json +1 -1
- package/_manifest/spdx_2.2/manifest.cat +0 -0
- package/_manifest/spdx_2.2/manifest.spdx.cose +0 -0
- package/_manifest/spdx_2.2/manifest.spdx.json +2077 -2077
- package/_manifest/spdx_2.2/manifest.spdx.json.sha256 +1 -1
- package/package.json +1 -1
- package/_manifest/spdx_2.2/ESRPClientLogs1209213734125.json +0 -1
|
@@ -62,6 +62,107 @@ export declare enum AlertType {
|
|
|
62
62
|
*/
|
|
63
63
|
License = 4
|
|
64
64
|
}
|
|
65
|
+
export declare enum AlertValidityStatus {
|
|
66
|
+
/**
|
|
67
|
+
* When there are no validation fingerprints attached to the alert.
|
|
68
|
+
*/
|
|
69
|
+
None = 0,
|
|
70
|
+
/**
|
|
71
|
+
* When the validations for validation fingerprints associated to the alert have not been conclusive.
|
|
72
|
+
*/
|
|
73
|
+
Unknown = 1,
|
|
74
|
+
/**
|
|
75
|
+
* When at least one validation fingerprint associated to the alert is exploitable.
|
|
76
|
+
*/
|
|
77
|
+
Active = 2,
|
|
78
|
+
/**
|
|
79
|
+
* When all validation fingerprints associated to the alert are not exploitable.
|
|
80
|
+
*/
|
|
81
|
+
Inactive = 3
|
|
82
|
+
}
|
|
83
|
+
export interface CombinedAlertFilterCriteria {
|
|
84
|
+
/**
|
|
85
|
+
* If provided, only return alerts whose titles match this pattern.
|
|
86
|
+
*/
|
|
87
|
+
keywords: string;
|
|
88
|
+
/**
|
|
89
|
+
* If provided, return alerts that are active or inactive based on this value. \<br /\>Otherwise, return alerts in any state.
|
|
90
|
+
*/
|
|
91
|
+
state: DashboardAlertState;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* An alert entity used in the dashboard for combined alerts.
|
|
95
|
+
*/
|
|
96
|
+
export interface DashboardAlert {
|
|
97
|
+
/**
|
|
98
|
+
* Identifier for the alert. It is unique within Azure DevOps organization.
|
|
99
|
+
*/
|
|
100
|
+
alertId: number;
|
|
101
|
+
/**
|
|
102
|
+
* Type of the alert. E.g. secret, code, etc.
|
|
103
|
+
*/
|
|
104
|
+
alertType: AlertType;
|
|
105
|
+
/**
|
|
106
|
+
* This value is computed and returned by the service. This value represents the first time the vulnerability was introduced.
|
|
107
|
+
*/
|
|
108
|
+
introducedDate: Date;
|
|
109
|
+
/**
|
|
110
|
+
* This value is computed and returned by the service. It is a value based on the results from all analysis configurations. An example of a physical location is a file location.
|
|
111
|
+
*/
|
|
112
|
+
locations: DashboardAlertPhysicalLocation[];
|
|
113
|
+
/**
|
|
114
|
+
* Name of the project where the alert was detected.
|
|
115
|
+
*/
|
|
116
|
+
projectName: string;
|
|
117
|
+
/**
|
|
118
|
+
* Name of the repository where the alert was detected.
|
|
119
|
+
*/
|
|
120
|
+
repositoryName: string;
|
|
121
|
+
/**
|
|
122
|
+
* Severity of the alert.
|
|
123
|
+
*/
|
|
124
|
+
severity: Severity;
|
|
125
|
+
/**
|
|
126
|
+
* This value is computed and returned by the service. It is a value based on the results from all analysis configurations.
|
|
127
|
+
*/
|
|
128
|
+
state: State;
|
|
129
|
+
/**
|
|
130
|
+
* Title will only be rendered as text and does not support markdown formatting. There is a maximum character limit of 256.
|
|
131
|
+
*/
|
|
132
|
+
title: string;
|
|
133
|
+
/**
|
|
134
|
+
* A truncated/obfuscated version of the secret pertaining to the alert (if applicable).
|
|
135
|
+
*/
|
|
136
|
+
truncatedSecret: string;
|
|
137
|
+
/**
|
|
138
|
+
* Validity status of an alert. Currently, this is only applicable to secret alerts. In case of secret alerts, the validity status is computed by looking at the liveness results for validation fingerprints associated to an alert.
|
|
139
|
+
*/
|
|
140
|
+
validityStatus: AlertValidityStatus;
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Location in the source control system where the issue was found
|
|
144
|
+
*/
|
|
145
|
+
export interface DashboardAlertPhysicalLocation {
|
|
146
|
+
alertId: number;
|
|
147
|
+
/**
|
|
148
|
+
* Path of the file where the issue was found
|
|
149
|
+
*/
|
|
150
|
+
filePath: string;
|
|
151
|
+
/**
|
|
152
|
+
* Details about the location where the issue was found including a snippet
|
|
153
|
+
*/
|
|
154
|
+
region: Region;
|
|
155
|
+
}
|
|
156
|
+
export declare enum DashboardAlertState {
|
|
157
|
+
/**
|
|
158
|
+
* Alert has been detected in the code and corresponds to 'Active' state.
|
|
159
|
+
*/
|
|
160
|
+
Open = 0,
|
|
161
|
+
/**
|
|
162
|
+
* Alert corresponds to 'Unknown', 'Dismissed', 'Fixed' or 'AutoDismissed' states.
|
|
163
|
+
*/
|
|
164
|
+
Closed = 1
|
|
165
|
+
}
|
|
65
166
|
export interface EnablementFilterCriteria {
|
|
66
167
|
/**
|
|
67
168
|
* If provided, only return repos whose titles match this pattern.
|
|
@@ -192,6 +293,24 @@ export interface ProjectEnablementSummary {
|
|
|
192
293
|
*/
|
|
193
294
|
repos: RepoEnablementSummary[];
|
|
194
295
|
}
|
|
296
|
+
export interface Region {
|
|
297
|
+
/**
|
|
298
|
+
* The column where the code snippet ends
|
|
299
|
+
*/
|
|
300
|
+
columnEnd: number;
|
|
301
|
+
/**
|
|
302
|
+
* The column where the code snippet starts
|
|
303
|
+
*/
|
|
304
|
+
columnStart: number;
|
|
305
|
+
/**
|
|
306
|
+
* The line number where the code snippet ends
|
|
307
|
+
*/
|
|
308
|
+
lineEnd: number;
|
|
309
|
+
/**
|
|
310
|
+
* The line number where the code snippet starts
|
|
311
|
+
*/
|
|
312
|
+
lineStart: number;
|
|
313
|
+
}
|
|
195
314
|
/**
|
|
196
315
|
* Repo Alert Summary.
|
|
197
316
|
*/
|
|
@@ -241,6 +360,12 @@ export interface RepoEnablementSummary {
|
|
|
241
360
|
* Repo Name.
|
|
242
361
|
*/
|
|
243
362
|
repoName: string;
|
|
363
|
+
/**
|
|
364
|
+
* Repo scan type metadata for different scan types.
|
|
365
|
+
*/
|
|
366
|
+
scanTypeMetadata: {
|
|
367
|
+
[key: number]: ScanTypeSummaryMetadata;
|
|
368
|
+
};
|
|
244
369
|
/**
|
|
245
370
|
* Repo enablement summary for different scan types.
|
|
246
371
|
*/
|
|
@@ -258,6 +383,15 @@ export interface ReportingUXComputedFilters {
|
|
|
258
383
|
*/
|
|
259
384
|
projects: Project[];
|
|
260
385
|
}
|
|
386
|
+
/**
|
|
387
|
+
* Metadata for a scan type.
|
|
388
|
+
*/
|
|
389
|
+
export interface ScanTypeSummaryMetadata {
|
|
390
|
+
/**
|
|
391
|
+
* The date and time of the last scan for the associated alert type/repo combination. Null if no scan has been performed.
|
|
392
|
+
*/
|
|
393
|
+
lastScanDate: Date;
|
|
394
|
+
}
|
|
261
395
|
export interface ScanTypeSummaryProperties {
|
|
262
396
|
/**
|
|
263
397
|
* True if alerts are enabled for the associated alert type/repo combination, false if disabled.
|
|
@@ -288,6 +422,28 @@ export declare enum Severity {
|
|
|
288
422
|
Error = 6,
|
|
289
423
|
Undefined = 7
|
|
290
424
|
}
|
|
425
|
+
export declare enum State {
|
|
426
|
+
/**
|
|
427
|
+
* Alert is in an indeterminate state
|
|
428
|
+
*/
|
|
429
|
+
Unknown = 0,
|
|
430
|
+
/**
|
|
431
|
+
* Alert has been detected in the code
|
|
432
|
+
*/
|
|
433
|
+
Active = 1,
|
|
434
|
+
/**
|
|
435
|
+
* Alert was dismissed by a user
|
|
436
|
+
*/
|
|
437
|
+
Dismissed = 2,
|
|
438
|
+
/**
|
|
439
|
+
* The issue is no longer detected in the code
|
|
440
|
+
*/
|
|
441
|
+
Fixed = 4,
|
|
442
|
+
/**
|
|
443
|
+
* The tool has determined that the issue is no longer a risk
|
|
444
|
+
*/
|
|
445
|
+
AutoDismissed = 8
|
|
446
|
+
}
|
|
291
447
|
export declare enum TimePeriod {
|
|
292
448
|
Undefined = 0,
|
|
293
449
|
Last24Hours = 5,
|
|
@@ -29,6 +29,36 @@ define(["require", "exports"], function (require, exports) {
|
|
|
29
29
|
*/
|
|
30
30
|
AlertType[AlertType["License"] = 4] = "License";
|
|
31
31
|
})(AlertType = exports.AlertType || (exports.AlertType = {}));
|
|
32
|
+
var AlertValidityStatus;
|
|
33
|
+
(function (AlertValidityStatus) {
|
|
34
|
+
/**
|
|
35
|
+
* When there are no validation fingerprints attached to the alert.
|
|
36
|
+
*/
|
|
37
|
+
AlertValidityStatus[AlertValidityStatus["None"] = 0] = "None";
|
|
38
|
+
/**
|
|
39
|
+
* When the validations for validation fingerprints associated to the alert have not been conclusive.
|
|
40
|
+
*/
|
|
41
|
+
AlertValidityStatus[AlertValidityStatus["Unknown"] = 1] = "Unknown";
|
|
42
|
+
/**
|
|
43
|
+
* When at least one validation fingerprint associated to the alert is exploitable.
|
|
44
|
+
*/
|
|
45
|
+
AlertValidityStatus[AlertValidityStatus["Active"] = 2] = "Active";
|
|
46
|
+
/**
|
|
47
|
+
* When all validation fingerprints associated to the alert are not exploitable.
|
|
48
|
+
*/
|
|
49
|
+
AlertValidityStatus[AlertValidityStatus["Inactive"] = 3] = "Inactive";
|
|
50
|
+
})(AlertValidityStatus = exports.AlertValidityStatus || (exports.AlertValidityStatus = {}));
|
|
51
|
+
var DashboardAlertState;
|
|
52
|
+
(function (DashboardAlertState) {
|
|
53
|
+
/**
|
|
54
|
+
* Alert has been detected in the code and corresponds to 'Active' state.
|
|
55
|
+
*/
|
|
56
|
+
DashboardAlertState[DashboardAlertState["Open"] = 0] = "Open";
|
|
57
|
+
/**
|
|
58
|
+
* Alert corresponds to 'Unknown', 'Dismissed', 'Fixed' or 'AutoDismissed' states.
|
|
59
|
+
*/
|
|
60
|
+
DashboardAlertState[DashboardAlertState["Closed"] = 1] = "Closed";
|
|
61
|
+
})(DashboardAlertState = exports.DashboardAlertState || (exports.DashboardAlertState = {}));
|
|
32
62
|
var Severity;
|
|
33
63
|
(function (Severity) {
|
|
34
64
|
Severity[Severity["Low"] = 0] = "Low";
|
|
@@ -40,6 +70,29 @@ define(["require", "exports"], function (require, exports) {
|
|
|
40
70
|
Severity[Severity["Error"] = 6] = "Error";
|
|
41
71
|
Severity[Severity["Undefined"] = 7] = "Undefined";
|
|
42
72
|
})(Severity = exports.Severity || (exports.Severity = {}));
|
|
73
|
+
var State;
|
|
74
|
+
(function (State) {
|
|
75
|
+
/**
|
|
76
|
+
* Alert is in an indeterminate state
|
|
77
|
+
*/
|
|
78
|
+
State[State["Unknown"] = 0] = "Unknown";
|
|
79
|
+
/**
|
|
80
|
+
* Alert has been detected in the code
|
|
81
|
+
*/
|
|
82
|
+
State[State["Active"] = 1] = "Active";
|
|
83
|
+
/**
|
|
84
|
+
* Alert was dismissed by a user
|
|
85
|
+
*/
|
|
86
|
+
State[State["Dismissed"] = 2] = "Dismissed";
|
|
87
|
+
/**
|
|
88
|
+
* The issue is no longer detected in the code
|
|
89
|
+
*/
|
|
90
|
+
State[State["Fixed"] = 4] = "Fixed";
|
|
91
|
+
/**
|
|
92
|
+
* The tool has determined that the issue is no longer a risk
|
|
93
|
+
*/
|
|
94
|
+
State[State["AutoDismissed"] = 8] = "AutoDismissed";
|
|
95
|
+
})(State = exports.State || (exports.State = {}));
|
|
43
96
|
var TimePeriod;
|
|
44
97
|
(function (TimePeriod) {
|
|
45
98
|
TimePeriod[TimePeriod["Undefined"] = 0] = "Undefined";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
define(["require","exports"],function(e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});!function(e){e[e.Unknown=0]="Unknown",e[e.Dependency=1]="Dependency",e[e.Secret=2]="Secret",e[e.Code=3]="Code",e[e.License=4]="License"}(n.AlertType||(n.AlertType={}));!function(e){e[e.Low=0]="Low",e[e.Medium=1]="Medium",e[e.High=2]="High",e[e.Critical=3]="Critical",e[e.Note=4]="Note",e[e.Warning=5]="Warning",e[e.Error=6]="Error",e[e.Undefined=7]="Undefined"}(n.Severity||(n.Severity={}));!function(e){e[e.Undefined=0]="Undefined",e[e.Last24Hours=5]="Last24Hours",e[e.Last7Days=6]="Last7Days",e[e.Last14Days=7]="Last14Days",e[e.Last30Days=8]="Last30Days",e[e.Last90Days=9]="Last90Days"}(n.TimePeriod||(n.TimePeriod={}))});
|
|
1
|
+
define(["require","exports"],function(e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});!function(e){e[e.Unknown=0]="Unknown",e[e.Dependency=1]="Dependency",e[e.Secret=2]="Secret",e[e.Code=3]="Code",e[e.License=4]="License"}(n.AlertType||(n.AlertType={}));!function(e){e[e.None=0]="None",e[e.Unknown=1]="Unknown",e[e.Active=2]="Active",e[e.Inactive=3]="Inactive"}(n.AlertValidityStatus||(n.AlertValidityStatus={}));!function(e){e[e.Open=0]="Open",e[e.Closed=1]="Closed"}(n.DashboardAlertState||(n.DashboardAlertState={}));!function(e){e[e.Low=0]="Low",e[e.Medium=1]="Medium",e[e.High=2]="High",e[e.Critical=3]="Critical",e[e.Note=4]="Note",e[e.Warning=5]="Warning",e[e.Error=6]="Error",e[e.Undefined=7]="Undefined"}(n.Severity||(n.Severity={}));!function(e){e[e.Unknown=0]="Unknown",e[e.Active=1]="Active",e[e.Dismissed=2]="Dismissed",e[e.Fixed=4]="Fixed",e[e.AutoDismissed=8]="AutoDismissed"}(n.State||(n.State={}));!function(e){e[e.Undefined=0]="Undefined",e[e.Last24Hours=5]="Last24Hours",e[e.Last7Days=6]="Last7Days",e[e.Last14Days=7]="Last14Days",e[e.Last30Days=8]="Last30Days",e[e.Last90Days=9]="Last90Days"}(n.TimePeriod||(n.TimePeriod={}))});
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { IVssRestClientOptions } from "../Common/Context";
|
|
2
2
|
import { RestClientBase } from "../Common/RestClientBase";
|
|
3
3
|
import * as Reporting from "../AdvancedSecurity.Reporting/Reporting";
|
|
4
|
+
import * as WebApi from "../WebApi/WebApi";
|
|
4
5
|
export declare class ReportingRestClient extends RestClientBase {
|
|
5
6
|
constructor(options: IVssRestClientOptions);
|
|
6
7
|
/**
|
|
@@ -9,11 +10,21 @@ export declare class ReportingRestClient extends RestClientBase {
|
|
|
9
10
|
/**
|
|
10
11
|
* Get Alert summary by severity for the org
|
|
11
12
|
*
|
|
12
|
-
* @param criteria -
|
|
13
|
+
* @param criteria - Options to limit the summaries returned
|
|
13
14
|
*/
|
|
14
15
|
getAlertSummaryForOrg(criteria?: Reporting.FilterCriteria): Promise<Reporting.OrgAlertSummary>;
|
|
15
16
|
/**
|
|
16
|
-
*
|
|
17
|
+
* Get Combined Alerts for the org
|
|
18
|
+
*
|
|
19
|
+
* @param criteria - Options to filter the combined alerts returned
|
|
20
|
+
* @param top - The maximum number of alerts to return
|
|
21
|
+
* @param continuationToken - If there are more alerts than can be returned, a continuation token is placed in the "x-ms-continuationtoken" header. Use that token here to get the next page of alerts
|
|
22
|
+
*/
|
|
23
|
+
getCombinedAlertsForOrg(criteria?: Reporting.CombinedAlertFilterCriteria, top?: number, continuationToken?: string): Promise<WebApi.PagedList<Reporting.DashboardAlert>>;
|
|
24
|
+
/**
|
|
25
|
+
* Get Enablement summary for the org
|
|
26
|
+
*
|
|
27
|
+
* @param criteria - Options to limit the summaries returned
|
|
17
28
|
*/
|
|
18
29
|
getEnablementSummaryForOrg(criteria?: Reporting.EnablementFilterCriteria): Promise<Reporting.OrgEnablementSummary>;
|
|
19
30
|
}
|
|
@@ -48,7 +48,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
48
48
|
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
49
49
|
}
|
|
50
50
|
};
|
|
51
|
-
define(["require", "exports", "../Common/RestClientBase"], function (require, exports, RestClientBase_1) {
|
|
51
|
+
define(["require", "exports", "../Common/RestClientBase", "../Common/Util/Serialization"], function (require, exports, RestClientBase_1, Serialization_1) {
|
|
52
52
|
"use strict";
|
|
53
53
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
54
54
|
var ReportingRestClient = /** @class */ (function (_super) {
|
|
@@ -74,7 +74,7 @@ define(["require", "exports", "../Common/RestClientBase"], function (require, ex
|
|
|
74
74
|
/**
|
|
75
75
|
* Get Alert summary by severity for the org
|
|
76
76
|
*
|
|
77
|
-
* @param criteria -
|
|
77
|
+
* @param criteria - Options to limit the summaries returned
|
|
78
78
|
*/
|
|
79
79
|
ReportingRestClient.prototype.getAlertSummaryForOrg = function (criteria) {
|
|
80
80
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -95,7 +95,49 @@ define(["require", "exports", "../Common/RestClientBase"], function (require, ex
|
|
|
95
95
|
});
|
|
96
96
|
};
|
|
97
97
|
/**
|
|
98
|
-
*
|
|
98
|
+
* Get Combined Alerts for the org
|
|
99
|
+
*
|
|
100
|
+
* @param criteria - Options to filter the combined alerts returned
|
|
101
|
+
* @param top - The maximum number of alerts to return
|
|
102
|
+
* @param continuationToken - If there are more alerts than can be returned, a continuation token is placed in the "x-ms-continuationtoken" header. Use that token here to get the next page of alerts
|
|
103
|
+
*/
|
|
104
|
+
ReportingRestClient.prototype.getCombinedAlertsForOrg = function (criteria, top, continuationToken) {
|
|
105
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
106
|
+
var queryValues;
|
|
107
|
+
var _this = this;
|
|
108
|
+
return __generator(this, function (_a) {
|
|
109
|
+
queryValues = {
|
|
110
|
+
criteria: criteria,
|
|
111
|
+
top: top,
|
|
112
|
+
continuationToken: continuationToken
|
|
113
|
+
};
|
|
114
|
+
return [2 /*return*/, this.beginRequest({
|
|
115
|
+
apiVersion: "7.2-preview.1",
|
|
116
|
+
routeTemplate: "_apis/Reporting/summary/{action}",
|
|
117
|
+
routeValues: {
|
|
118
|
+
action: "AlertsBatch"
|
|
119
|
+
},
|
|
120
|
+
queryParams: queryValues,
|
|
121
|
+
returnRawResponse: true
|
|
122
|
+
}).then(function (response) { return __awaiter(_this, void 0, void 0, function () {
|
|
123
|
+
var body;
|
|
124
|
+
return __generator(this, function (_a) {
|
|
125
|
+
switch (_a.label) {
|
|
126
|
+
case 0: return [4 /*yield*/, response.text().then(Serialization_1.deserializeVssJsonObject)];
|
|
127
|
+
case 1:
|
|
128
|
+
body = _a.sent();
|
|
129
|
+
body.continuationToken = response.headers.get("x-ms-continuationtoken");
|
|
130
|
+
return [2 /*return*/, body];
|
|
131
|
+
}
|
|
132
|
+
});
|
|
133
|
+
}); })];
|
|
134
|
+
});
|
|
135
|
+
});
|
|
136
|
+
};
|
|
137
|
+
/**
|
|
138
|
+
* Get Enablement summary for the org
|
|
139
|
+
*
|
|
140
|
+
* @param criteria - Options to limit the summaries returned
|
|
99
141
|
*/
|
|
100
142
|
ReportingRestClient.prototype.getEnablementSummaryForOrg = function (criteria) {
|
|
101
143
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var __extends=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var
|
|
1
|
+
var __extends=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),__awaiter=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))(function(i,o){function a(t){try{s(r.next(t))}catch(t){o(t)}}function u(t){try{s(r.throw(t))}catch(t){o(t)}}function s(t){t.done?i(t.value):new n(function(e){e(t.value)}).then(a,u)}s((r=r.apply(t,e||[])).next())})},__generator=this&&this.__generator||function(t,e){function n(n){return function(a){return function(n){if(r)throw new TypeError("Generator is already executing.");for(;u;)try{if(r=1,i&&(o=2&n[0]?i.return:n[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,n[1])).done)return o;switch(i=0,o&&(n=[2&n[0],o.value]),n[0]){case 0:case 1:o=n;break;case 4:return u.label++,{value:n[1],done:!1};case 5:u.label++,i=n[1],n=[0];continue;case 7:n=u.ops.pop(),u.trys.pop();continue;default:if(o=u.trys,!(o=o.length>0&&o[o.length-1])&&(6===n[0]||2===n[0])){u=0;continue}if(3===n[0]&&(!o||n[1]>o[0]&&n[1]<o[3])){u.label=n[1];break}if(6===n[0]&&u.label<o[1]){u.label=o[1],o=n;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(n);break}o[2]&&u.ops.pop(),u.trys.pop();continue}n=e.call(t,u)}catch(t){n=[6,t],i=0}finally{r=o=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}([n,a])}}var r,i,o,a,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:n(0),throw:n(1),return:n(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a};define(["require","exports","../Common/RestClientBase","../Common/Util/Serialization"],function(t,e,n,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(t){function e(e){return t.call(this,e)||this}return __extends(e,t),e.prototype.getUXComputedFilters=function(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(t){return[2,this.beginRequest({apiVersion:"7.2-preview.1",routeTemplate:"_apis/Reporting/filters/{action}",routeValues:{action:"Default"}})]})})},e.prototype.getAlertSummaryForOrg=function(t){return __awaiter(this,void 0,void 0,function(){var e;return __generator(this,function(n){return e={criteria:t},[2,this.beginRequest({apiVersion:"7.2-preview.1",routeTemplate:"_apis/Reporting/summary/{action}",routeValues:{action:"Alerts"},queryParams:e})]})})},e.prototype.getCombinedAlertsForOrg=function(t,e,n){return __awaiter(this,void 0,void 0,function(){var i,o=this;return __generator(this,function(a){return i={criteria:t,top:e,continuationToken:n},[2,this.beginRequest({apiVersion:"7.2-preview.1",routeTemplate:"_apis/Reporting/summary/{action}",routeValues:{action:"AlertsBatch"},queryParams:i,returnRawResponse:!0}).then(function(t){return __awaiter(o,void 0,void 0,function(){var e;return __generator(this,function(n){switch(n.label){case 0:return[4,t.text().then(r.deserializeVssJsonObject)];case 1:return e=n.sent(),e.continuationToken=t.headers.get("x-ms-continuationtoken"),[2,e]}})})})]})})},e.prototype.getEnablementSummaryForOrg=function(t){return __awaiter(this,void 0,void 0,function(){var e;return __generator(this,function(n){return e={criteria:t},[2,this.beginRequest({apiVersion:"7.2-preview.1",routeTemplate:"_apis/Reporting/summary/{action}",routeValues:{action:"Enablement"},queryParams:e})]})})},e}(n.RestClientBase);e.ReportingRestClient=i});
|
package/Alert/Alert.d.ts
CHANGED
|
@@ -34,6 +34,10 @@ export interface Alert {
|
|
|
34
34
|
* Reference to a git object, e.g. branch ref.
|
|
35
35
|
*/
|
|
36
36
|
gitRef: string;
|
|
37
|
+
/**
|
|
38
|
+
* Value indicates whether the alert comes from a SARIF uploaded by a trusted source.
|
|
39
|
+
*/
|
|
40
|
+
hasTrustedSourceOrigin: boolean;
|
|
37
41
|
/**
|
|
38
42
|
* This value is computed and returned by the service. This value represents the first time the vulnerability was introduced.
|
|
39
43
|
*/
|
|
@@ -124,6 +128,19 @@ export interface AlertAnalysisInstance {
|
|
|
124
128
|
*/
|
|
125
129
|
state: State;
|
|
126
130
|
}
|
|
131
|
+
/**
|
|
132
|
+
* Request model for getting alerts by IDs with optional alert type filter.
|
|
133
|
+
*/
|
|
134
|
+
export interface AlertBatchRequest {
|
|
135
|
+
/**
|
|
136
|
+
* List of alert IDs to retrieve.
|
|
137
|
+
*/
|
|
138
|
+
alertIds: number[];
|
|
139
|
+
/**
|
|
140
|
+
* Alert type of the alert IDs.
|
|
141
|
+
*/
|
|
142
|
+
alertType: AlertType;
|
|
143
|
+
}
|
|
127
144
|
export declare enum AlertListExpandOption {
|
|
128
145
|
/**
|
|
129
146
|
* No Expands.
|
|
@@ -147,6 +164,19 @@ export interface AlertMetadata {
|
|
|
147
164
|
*/
|
|
148
165
|
metadata: Metadata[];
|
|
149
166
|
}
|
|
167
|
+
/**
|
|
168
|
+
* Alert metadata.
|
|
169
|
+
*/
|
|
170
|
+
export interface AlertMetadataBatchRequest {
|
|
171
|
+
/**
|
|
172
|
+
* List of alert IDs.
|
|
173
|
+
*/
|
|
174
|
+
alertIds: number[];
|
|
175
|
+
/**
|
|
176
|
+
* The flag to control error policy in a bulk get work items request. Possible options are \{Fail, Omit\}.
|
|
177
|
+
*/
|
|
178
|
+
errorPolicy: AlertMetadataErrorPolicy;
|
|
179
|
+
}
|
|
150
180
|
/**
|
|
151
181
|
* Used to represent an update in a relationship between an alert and an artifact.
|
|
152
182
|
*/
|
|
@@ -160,6 +190,19 @@ export interface AlertMetadataChange {
|
|
|
160
190
|
*/
|
|
161
191
|
metadataChange: MetadataChange;
|
|
162
192
|
}
|
|
193
|
+
/**
|
|
194
|
+
* Enum to control error policy in a bulk get alert metadata items request.
|
|
195
|
+
*/
|
|
196
|
+
export declare enum AlertMetadataErrorPolicy {
|
|
197
|
+
/**
|
|
198
|
+
* Fail error policy: if an alert id is not found, the whole request fails.
|
|
199
|
+
*/
|
|
200
|
+
Fail = 1,
|
|
201
|
+
/**
|
|
202
|
+
* Omit error policy: if an alert id is not found, it will be omitted from the results.
|
|
203
|
+
*/
|
|
204
|
+
Omit = 2
|
|
205
|
+
}
|
|
163
206
|
export interface AlertStateUpdate {
|
|
164
207
|
dismissedComment: string;
|
|
165
208
|
dismissedReason: DismissalType;
|
|
@@ -1082,6 +1125,10 @@ export interface ValidationFingerprint {
|
|
|
1082
1125
|
assetFingerprint: {
|
|
1083
1126
|
[key: string]: string;
|
|
1084
1127
|
};
|
|
1128
|
+
/**
|
|
1129
|
+
* Represents the CrossCompanyCorrelatingId for the secret in the ValidationFingerprintJson.
|
|
1130
|
+
*/
|
|
1131
|
+
c3Id: string;
|
|
1085
1132
|
/**
|
|
1086
1133
|
* The hash associated to the secret.
|
|
1087
1134
|
*/
|
package/Alert/Alert.js
CHANGED
|
@@ -17,6 +17,20 @@ define(["require", "exports"], function (require, exports) {
|
|
|
17
17
|
*/
|
|
18
18
|
AlertListExpandOption[AlertListExpandOption["Minimal"] = 1] = "Minimal";
|
|
19
19
|
})(AlertListExpandOption = exports.AlertListExpandOption || (exports.AlertListExpandOption = {}));
|
|
20
|
+
/**
|
|
21
|
+
* Enum to control error policy in a bulk get alert metadata items request.
|
|
22
|
+
*/
|
|
23
|
+
var AlertMetadataErrorPolicy;
|
|
24
|
+
(function (AlertMetadataErrorPolicy) {
|
|
25
|
+
/**
|
|
26
|
+
* Fail error policy: if an alert id is not found, the whole request fails.
|
|
27
|
+
*/
|
|
28
|
+
AlertMetadataErrorPolicy[AlertMetadataErrorPolicy["Fail"] = 1] = "Fail";
|
|
29
|
+
/**
|
|
30
|
+
* Omit error policy: if an alert id is not found, it will be omitted from the results.
|
|
31
|
+
*/
|
|
32
|
+
AlertMetadataErrorPolicy[AlertMetadataErrorPolicy["Omit"] = 2] = "Omit";
|
|
33
|
+
})(AlertMetadataErrorPolicy = exports.AlertMetadataErrorPolicy || (exports.AlertMetadataErrorPolicy = {}));
|
|
20
34
|
var AlertType;
|
|
21
35
|
(function (AlertType) {
|
|
22
36
|
/**
|
package/Alert/Alert.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
define(["require","exports"],function(e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});!function(e){e[e.None=0]="None",e[e.Minimal=1]="Minimal"}(n.AlertListExpandOption||(n.AlertListExpandOption={}));!function(e){e[e.Unknown=0]="Unknown",e[e.Dependency=1]="Dependency",e[e.Secret=2]="Secret",e[e.Code=3]="Code",e[e.License=4]="License"}(n.AlertType||(n.AlertType={}));!function(e){e[e.None=0]="None",e[e.Created=1]="Created",e[e.InProgress=2]="InProgress",e[e.Completed=3]="Completed",e[e.Failed=4]="Failed"}(n.AlertValidationRequestStatus||(n.AlertValidationRequestStatus={}));!function(e){e[e.None=0]="None",e[e.Unknown=1]="Unknown",e[e.Active=2]="Active",e[e.Inactive=3]="Inactive"}(n.AlertValidityStatus||(n.AlertValidityStatus={}));!function(e){e[e.Default=0]="Default",e[e.AdoPipeline=1]="AdoPipeline"}(n.AnalysisConfigurationType||(n.AnalysisConfigurationType={}));!function(e){e[e.Unknown=0]="Unknown",e[e.NuGet=1]="NuGet",e[e.Npm=2]="Npm",e[e.Maven=3]="Maven",e[e.Git=4]="Git",e[e.Other=5]="Other",e[e.RubyGems=6]="RubyGems",e[e.Cargo=7]="Cargo",e[e.Pip=8]="Pip",e[e.File=9]="File",e[e.Go=10]="Go",e[e.DockerImage=11]="DockerImage",e[e.Pod=12]="Pod",e[e.Linux=13]="Linux",e[e.Conda=14]="Conda",e[e.DockerReference=15]="DockerReference",e[e.Vcpkg=16]="Vcpkg"}(n.ComponentType||(n.ComponentType={}));!function(e){e[e.High=0]="High",e[e.Other=1]="Other"}(n.Confidence||(n.Confidence={}));!function(e){e[e.Unknown=0]="Unknown",e[e.RootDependency=1]="RootDependency",e[e.Component=2]="Component",e[e.VulnerableDependency=3]="VulnerableDependency"}(n.DependencyKind||(n.DependencyKind={}));!function(e){e[e.Unknown=0]="Unknown",e[e.Fixed=1]="Fixed",e[e.AcceptedRisk=2]="AcceptedRisk",e[e.FalsePositive=3]="FalsePositive",e[e.AgreedToGuidance=4]="AgreedToGuidance",e[e.ToolUpgrade=5]="ToolUpgrade",e[e.NotDistributed=6]="NotDistributed"}(n.DismissalType||(n.DismissalType={}));!function(e){e[e.None=0]="None",e[e.ValidationFingerprint=1]="ValidationFingerprint"}(n.ExpandOption||(n.ExpandOption={}));!function(e){e[e.Unknown=0]="Unknown",e[e.NotHarvested=1]="NotHarvested",e[e.Harvested=2]="Harvested"}(n.LicenseState||(n.LicenseState={}));!function(e){e[e.Unknown=0]="Unknown",e[e.Permissive=1]="Permissive",e[e.WeakCopyleft=2]="WeakCopyleft",e[e.StrongCopyleft=3]="StrongCopyleft",e[e.NetworkCopyleft=4]="NetworkCopyleft",e[e.Other=5]="Other",e[e.NoAssertion=6]="NoAssertion"}(n.LicenseType||(n.LicenseType={}));!function(e){e[e.None=0]="None",e[e.Created=1]="Created",e[e.Updated=2]="Updated",e[e.Deleted=3]="Deleted"}(n.MetadataChangeType||(n.MetadataChangeType={}));!function(e){e[e.None=0]="None",e[e.Add=1]="Add",e[e.Remove=2]="Remove"}(n.MetadataOperation||(n.MetadataOperation={}));!function(e){e[e.Unknown=0]="Unknown",e[e.Dependency=1]="Dependency",e[e.VersionControl=2]="VersionControl"}(n.ResultType||(n.ResultType={}));!function(e){e[e.New=0]="New",e[e.Queued=1]="Queued",e[e.Completed=2]="Completed",e[e.Failed=3]="Failed",e[e.Requeued=4]="Requeued"}(n.SarifJobStatus||(n.SarifJobStatus={}));!function(e){e[e.Low=0]="Low",e[e.Medium=1]="Medium",e[e.High=2]="High",e[e.Critical=3]="Critical",e[e.Note=4]="Note",e[e.Warning=5]="Warning",e[e.Error=6]="Error",e[e.Undefined=7]="Undefined"}(n.Severity||(n.Severity={}));!function(e){e[e.Unknown=0]="Unknown",e[e.Active=1]="Active",e[e.Dismissed=2]="Dismissed",e[e.Fixed=4]="Fixed",e[e.AutoDismissed=8]="AutoDismissed"}(n.State||(n.State={}));!function(e){e[e.None=0]="None",e[e.Exploitable=1]="Exploitable",e[e.NotExploitable=2]="NotExploitable",e[e.Inconclusive=3]="Inconclusive",e[e.ValidationNotSupported=4]="ValidationNotSupported",e[e.TransientError=5]="TransientError"}(n.ValidationResult||(n.ValidationResult={}))});
|
|
1
|
+
define(["require","exports"],function(e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});!function(e){e[e.None=0]="None",e[e.Minimal=1]="Minimal"}(n.AlertListExpandOption||(n.AlertListExpandOption={}));!function(e){e[e.Fail=1]="Fail",e[e.Omit=2]="Omit"}(n.AlertMetadataErrorPolicy||(n.AlertMetadataErrorPolicy={}));!function(e){e[e.Unknown=0]="Unknown",e[e.Dependency=1]="Dependency",e[e.Secret=2]="Secret",e[e.Code=3]="Code",e[e.License=4]="License"}(n.AlertType||(n.AlertType={}));!function(e){e[e.None=0]="None",e[e.Created=1]="Created",e[e.InProgress=2]="InProgress",e[e.Completed=3]="Completed",e[e.Failed=4]="Failed"}(n.AlertValidationRequestStatus||(n.AlertValidationRequestStatus={}));!function(e){e[e.None=0]="None",e[e.Unknown=1]="Unknown",e[e.Active=2]="Active",e[e.Inactive=3]="Inactive"}(n.AlertValidityStatus||(n.AlertValidityStatus={}));!function(e){e[e.Default=0]="Default",e[e.AdoPipeline=1]="AdoPipeline"}(n.AnalysisConfigurationType||(n.AnalysisConfigurationType={}));!function(e){e[e.Unknown=0]="Unknown",e[e.NuGet=1]="NuGet",e[e.Npm=2]="Npm",e[e.Maven=3]="Maven",e[e.Git=4]="Git",e[e.Other=5]="Other",e[e.RubyGems=6]="RubyGems",e[e.Cargo=7]="Cargo",e[e.Pip=8]="Pip",e[e.File=9]="File",e[e.Go=10]="Go",e[e.DockerImage=11]="DockerImage",e[e.Pod=12]="Pod",e[e.Linux=13]="Linux",e[e.Conda=14]="Conda",e[e.DockerReference=15]="DockerReference",e[e.Vcpkg=16]="Vcpkg"}(n.ComponentType||(n.ComponentType={}));!function(e){e[e.High=0]="High",e[e.Other=1]="Other"}(n.Confidence||(n.Confidence={}));!function(e){e[e.Unknown=0]="Unknown",e[e.RootDependency=1]="RootDependency",e[e.Component=2]="Component",e[e.VulnerableDependency=3]="VulnerableDependency"}(n.DependencyKind||(n.DependencyKind={}));!function(e){e[e.Unknown=0]="Unknown",e[e.Fixed=1]="Fixed",e[e.AcceptedRisk=2]="AcceptedRisk",e[e.FalsePositive=3]="FalsePositive",e[e.AgreedToGuidance=4]="AgreedToGuidance",e[e.ToolUpgrade=5]="ToolUpgrade",e[e.NotDistributed=6]="NotDistributed"}(n.DismissalType||(n.DismissalType={}));!function(e){e[e.None=0]="None",e[e.ValidationFingerprint=1]="ValidationFingerprint"}(n.ExpandOption||(n.ExpandOption={}));!function(e){e[e.Unknown=0]="Unknown",e[e.NotHarvested=1]="NotHarvested",e[e.Harvested=2]="Harvested"}(n.LicenseState||(n.LicenseState={}));!function(e){e[e.Unknown=0]="Unknown",e[e.Permissive=1]="Permissive",e[e.WeakCopyleft=2]="WeakCopyleft",e[e.StrongCopyleft=3]="StrongCopyleft",e[e.NetworkCopyleft=4]="NetworkCopyleft",e[e.Other=5]="Other",e[e.NoAssertion=6]="NoAssertion"}(n.LicenseType||(n.LicenseType={}));!function(e){e[e.None=0]="None",e[e.Created=1]="Created",e[e.Updated=2]="Updated",e[e.Deleted=3]="Deleted"}(n.MetadataChangeType||(n.MetadataChangeType={}));!function(e){e[e.None=0]="None",e[e.Add=1]="Add",e[e.Remove=2]="Remove"}(n.MetadataOperation||(n.MetadataOperation={}));!function(e){e[e.Unknown=0]="Unknown",e[e.Dependency=1]="Dependency",e[e.VersionControl=2]="VersionControl"}(n.ResultType||(n.ResultType={}));!function(e){e[e.New=0]="New",e[e.Queued=1]="Queued",e[e.Completed=2]="Completed",e[e.Failed=3]="Failed",e[e.Requeued=4]="Requeued"}(n.SarifJobStatus||(n.SarifJobStatus={}));!function(e){e[e.Low=0]="Low",e[e.Medium=1]="Medium",e[e.High=2]="High",e[e.Critical=3]="Critical",e[e.Note=4]="Note",e[e.Warning=5]="Warning",e[e.Error=6]="Error",e[e.Undefined=7]="Undefined"}(n.Severity||(n.Severity={}));!function(e){e[e.Unknown=0]="Unknown",e[e.Active=1]="Active",e[e.Dismissed=2]="Dismissed",e[e.Fixed=4]="Fixed",e[e.AutoDismissed=8]="AutoDismissed"}(n.State||(n.State={}));!function(e){e[e.None=0]="None",e[e.Exploitable=1]="Exploitable",e[e.NotExploitable=2]="NotExploitable",e[e.Inconclusive=3]="Inconclusive",e[e.ValidationNotSupported=4]="ValidationNotSupported",e[e.TransientError=5]="TransientError"}(n.ValidationResult||(n.ValidationResult={}))});
|
package/Alert/AlertClient.d.ts
CHANGED
|
@@ -45,6 +45,14 @@ export declare class AlertRestClient extends RestClientBase {
|
|
|
45
45
|
* @param repository - The name or ID of the repository
|
|
46
46
|
*/
|
|
47
47
|
updateAlert(stateUpdate: Alert.AlertStateUpdate, project: string, alertId: number, repository: string): Promise<Alert.Alert>;
|
|
48
|
+
/**
|
|
49
|
+
* Get alerts by alert IDs Currently supports fetching secret alerts only.
|
|
50
|
+
*
|
|
51
|
+
* @param request - Request containing alert IDs and optional alert type filter
|
|
52
|
+
* @param project - Project ID or project name
|
|
53
|
+
* @param repository - The name or ID of the repository
|
|
54
|
+
*/
|
|
55
|
+
getAlertsByIds(request: Alert.AlertBatchRequest, project: string, repository: string): Promise<Alert.Alert[]>;
|
|
48
56
|
/**
|
|
49
57
|
* Returns the branches for which analysis results were submitted.
|
|
50
58
|
*
|
|
@@ -89,6 +97,22 @@ export declare class AlertRestClient extends RestClientBase {
|
|
|
89
97
|
* @param repository - The name or ID of the repository.
|
|
90
98
|
*/
|
|
91
99
|
updateAlertsMetadata(alertsMetadata: Alert.AlertMetadata[], project: string, repository: string): Promise<Alert.AlertMetadataChange[]>;
|
|
100
|
+
/**
|
|
101
|
+
* Get an alert metadata.
|
|
102
|
+
*
|
|
103
|
+
* @param project - Project ID or project name
|
|
104
|
+
* @param alertId - ID of alert to retrieve
|
|
105
|
+
* @param repository - Name or id of a repository that alert is part of
|
|
106
|
+
*/
|
|
107
|
+
getAlertMetadata(project: string, alertId: number, repository: string): Promise<Alert.AlertMetadata>;
|
|
108
|
+
/**
|
|
109
|
+
* Get alerts metadata.
|
|
110
|
+
*
|
|
111
|
+
* @param alertMetadataBatchRequest -
|
|
112
|
+
* @param project - Project ID or project name
|
|
113
|
+
* @param repository - Name or id of a repository that alert is part of
|
|
114
|
+
*/
|
|
115
|
+
getAlertMetadataBatch(alertMetadataBatchRequest: Alert.AlertMetadataBatchRequest, project: string, repository: string): Promise<Alert.AlertMetadata[]>;
|
|
92
116
|
/**
|
|
93
117
|
* Get alerts by their IDs at the organization level. Only retruns alerts that the user has permission to view. Only returns alerts of sku plans that are enabled.
|
|
94
118
|
*
|
package/Alert/AlertClient.js
CHANGED
|
@@ -188,6 +188,29 @@ define(["require", "exports", "../Common/RestClientBase", "../Common/Util/Serial
|
|
|
188
188
|
});
|
|
189
189
|
});
|
|
190
190
|
};
|
|
191
|
+
/**
|
|
192
|
+
* Get alerts by alert IDs Currently supports fetching secret alerts only.
|
|
193
|
+
*
|
|
194
|
+
* @param request - Request containing alert IDs and optional alert type filter
|
|
195
|
+
* @param project - Project ID or project name
|
|
196
|
+
* @param repository - The name or ID of the repository
|
|
197
|
+
*/
|
|
198
|
+
AlertRestClient.prototype.getAlertsByIds = function (request, project, repository) {
|
|
199
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
200
|
+
return __generator(this, function (_a) {
|
|
201
|
+
return [2 /*return*/, this.beginRequest({
|
|
202
|
+
apiVersion: "7.2-preview.1",
|
|
203
|
+
method: "POST",
|
|
204
|
+
routeTemplate: "{project}/_apis/Alert/repositories/{repository}/AlertsBatch",
|
|
205
|
+
routeValues: {
|
|
206
|
+
project: project,
|
|
207
|
+
repository: repository
|
|
208
|
+
},
|
|
209
|
+
body: request
|
|
210
|
+
})];
|
|
211
|
+
});
|
|
212
|
+
});
|
|
213
|
+
};
|
|
191
214
|
/**
|
|
192
215
|
* Returns the branches for which analysis results were submitted.
|
|
193
216
|
*
|
|
@@ -328,6 +351,51 @@ define(["require", "exports", "../Common/RestClientBase", "../Common/Util/Serial
|
|
|
328
351
|
});
|
|
329
352
|
});
|
|
330
353
|
};
|
|
354
|
+
/**
|
|
355
|
+
* Get an alert metadata.
|
|
356
|
+
*
|
|
357
|
+
* @param project - Project ID or project name
|
|
358
|
+
* @param alertId - ID of alert to retrieve
|
|
359
|
+
* @param repository - Name or id of a repository that alert is part of
|
|
360
|
+
*/
|
|
361
|
+
AlertRestClient.prototype.getAlertMetadata = function (project, alertId, repository) {
|
|
362
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
363
|
+
return __generator(this, function (_a) {
|
|
364
|
+
return [2 /*return*/, this.beginRequest({
|
|
365
|
+
apiVersion: "7.2-preview.1",
|
|
366
|
+
routeTemplate: "{project}/_apis/Alert/repositories/{repository}/alerts/{alertId}/metadata",
|
|
367
|
+
routeValues: {
|
|
368
|
+
project: project,
|
|
369
|
+
alertId: alertId,
|
|
370
|
+
repository: repository
|
|
371
|
+
}
|
|
372
|
+
})];
|
|
373
|
+
});
|
|
374
|
+
});
|
|
375
|
+
};
|
|
376
|
+
/**
|
|
377
|
+
* Get alerts metadata.
|
|
378
|
+
*
|
|
379
|
+
* @param alertMetadataBatchRequest -
|
|
380
|
+
* @param project - Project ID or project name
|
|
381
|
+
* @param repository - Name or id of a repository that alert is part of
|
|
382
|
+
*/
|
|
383
|
+
AlertRestClient.prototype.getAlertMetadataBatch = function (alertMetadataBatchRequest, project, repository) {
|
|
384
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
385
|
+
return __generator(this, function (_a) {
|
|
386
|
+
return [2 /*return*/, this.beginRequest({
|
|
387
|
+
apiVersion: "7.2-preview.1",
|
|
388
|
+
method: "POST",
|
|
389
|
+
routeTemplate: "{project}/_apis/Alert/repositories/{repository}/alerts/MetadataBatch",
|
|
390
|
+
routeValues: {
|
|
391
|
+
project: project,
|
|
392
|
+
repository: repository
|
|
393
|
+
},
|
|
394
|
+
body: alertMetadataBatchRequest
|
|
395
|
+
})];
|
|
396
|
+
});
|
|
397
|
+
});
|
|
398
|
+
};
|
|
331
399
|
/**
|
|
332
400
|
* Get alerts by their IDs at the organization level. Only retruns alerts that the user has permission to view. Only returns alerts of sku plans that are enabled.
|
|
333
401
|
*
|