azure-devops-extension-api 4.265.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.
@@ -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
- * @param criteria -
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
- * @param criteria -
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 r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),__awaiter=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(o,i){function a(t){try{s(n.next(t))}catch(t){i(t)}}function u(t){try{s(n.throw(t))}catch(t){i(t)}}function s(t){t.done?o(t.value):new r(function(e){e(t.value)}).then(a,u)}s((n=n.apply(t,e||[])).next())})},__generator=this&&this.__generator||function(t,e){function r(r){return function(a){return function(r){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,o&&(i=2&r[0]?o.return:r[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,r[1])).done)return i;switch(o=0,i&&(r=[2&r[0],i.value]),r[0]){case 0:case 1:i=r;break;case 4:return u.label++,{value:r[1],done:!1};case 5:u.label++,o=r[1],r=[0];continue;case 7:r=u.ops.pop(),u.trys.pop();continue;default:if(i=u.trys,!(i=i.length>0&&i[i.length-1])&&(6===r[0]||2===r[0])){u=0;continue}if(3===r[0]&&(!i||r[1]>i[0]&&r[1]<i[3])){u.label=r[1];break}if(6===r[0]&&u.label<i[1]){u.label=i[1],i=r;break}if(i&&u.label<i[2]){u.label=i[2],u.ops.push(r);break}i[2]&&u.ops.pop(),u.trys.pop();continue}r=e.call(t,u)}catch(t){r=[6,t],o=0}finally{n=i=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,a])}}var n,o,i,a,u={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:r(0),throw:r(1),return:r(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a};define(["require","exports","../Common/RestClientBase"],function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=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(r){return e={criteria:t},[2,this.beginRequest({apiVersion:"7.2-preview.1",routeTemplate:"_apis/Reporting/summary/{action}",routeValues:{action:"Alerts"},queryParams:e})]})})},e.prototype.getEnablementSummaryForOrg=function(t){return __awaiter(this,void 0,void 0,function(){var e;return __generator(this,function(r){return e={criteria:t},[2,this.beginRequest({apiVersion:"7.2-preview.1",routeTemplate:"_apis/Reporting/summary/{action}",routeValues:{action:"Enablement"},queryParams:e})]})})},e}(r.RestClientBase);e.ReportingRestClient=n});
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
@@ -128,6 +128,19 @@ export interface AlertAnalysisInstance {
128
128
  */
129
129
  state: State;
130
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
+ }
131
144
  export declare enum AlertListExpandOption {
132
145
  /**
133
146
  * No Expands.
@@ -1112,6 +1125,10 @@ export interface ValidationFingerprint {
1112
1125
  assetFingerprint: {
1113
1126
  [key: string]: string;
1114
1127
  };
1128
+ /**
1129
+ * Represents the CrossCompanyCorrelatingId for the secret in the ValidationFingerprintJson.
1130
+ */
1131
+ c3Id: string;
1115
1132
  /**
1116
1133
  * The hash associated to the secret.
1117
1134
  */
@@ -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
  *
@@ -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
  *
@@ -1 +1 @@
1
- var __extends=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function o(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(o.prototype=r.prototype,new o)}}(),__awaiter=this&&this.__awaiter||function(e,t,r,o){return new(r||(r=Promise))(function(i,n){function a(e){try{u(o.next(e))}catch(e){n(e)}}function s(e){try{u(o.throw(e))}catch(e){n(e)}}function u(e){e.done?i(e.value):new r(function(t){t(e.value)}).then(a,s)}u((o=o.apply(e,t||[])).next())})},__generator=this&&this.__generator||function(e,t){function r(r){return function(a){return function(r){if(o)throw new TypeError("Generator is already executing.");for(;s;)try{if(o=1,i&&(n=2&r[0]?i.return:r[0]?i.throw||((n=i.return)&&n.call(i),0):i.next)&&!(n=n.call(i,r[1])).done)return n;switch(i=0,n&&(r=[2&r[0],n.value]),r[0]){case 0:case 1:n=r;break;case 4:return s.label++,{value:r[1],done:!1};case 5:s.label++,i=r[1],r=[0];continue;case 7:r=s.ops.pop(),s.trys.pop();continue;default:if(n=s.trys,!(n=n.length>0&&n[n.length-1])&&(6===r[0]||2===r[0])){s=0;continue}if(3===r[0]&&(!n||r[1]>n[0]&&r[1]<n[3])){s.label=r[1];break}if(6===r[0]&&s.label<n[1]){s.label=n[1],n=r;break}if(n&&s.label<n[2]){s.label=n[2],s.ops.push(r);break}n[2]&&s.ops.pop(),s.trys.pop();continue}r=t.call(e,s)}catch(e){r=[6,e],i=0}finally{o=n=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,a])}}var o,i,n,a,s={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return a={next:r(0),throw:r(1),return:r(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a};define(["require","exports","../Common/RestClientBase","../Common/Util/Serialization"],function(e,t,r,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(e){function t(t){return e.call(this,t)||this}return __extends(t,e),t.prototype.getAlert=function(e,t,r,o,i){return __awaiter(this,void 0,void 0,function(){var n;return __generator(this,function(a){return n={ref:o,expand:i},[2,this.beginRequest({apiVersion:"7.2-preview.1",routeTemplate:"{project}/_apis/Alert/repositories/{repository}/alerts/{alertId}",routeValues:{project:e,alertId:t,repository:r},queryParams:n})]})})},t.prototype.getAlerts=function(e,t,r,i,n,a,s){return __awaiter(this,void 0,void 0,function(){var u,p=this;return __generator(this,function(c){return u={top:r,orderBy:i,criteria:n,expand:a,continuationToken:s},[2,this.beginRequest({apiVersion:"7.2-preview.1",routeTemplate:"{project}/_apis/Alert/repositories/{repository}/alerts/{alertId}",routeValues:{project:e,repository:t},queryParams:u,returnRawResponse:!0}).then(function(e){return __awaiter(p,void 0,void 0,function(){var t;return __generator(this,function(r){switch(r.label){case 0:return[4,e.text().then(o.deserializeVssJsonObject)];case 1:return t=r.sent(),t.continuationToken=e.headers.get("x-ms-continuationtoken"),[2,t]}})})})]})})},t.prototype.getAlertSarif=function(e,t,r,o,i){return __awaiter(this,void 0,void 0,function(){var n;return __generator(this,function(a){return n={ref:o,expand:i},[2,this.beginRequest({apiVersion:"7.2-preview.1",routeTemplate:"{project}/_apis/Alert/repositories/{repository}/alerts/{alertId}",routeValues:{project:e,alertId:t,repository:r},queryParams:n})]})})},t.prototype.updateAlert=function(e,t,r,o){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(i){return[2,this.beginRequest({apiVersion:"7.2-preview.1",method:"PATCH",routeTemplate:"{project}/_apis/Alert/repositories/{repository}/alerts/{alertId}",routeValues:{project:t,alertId:r,repository:o},body:e})]})})},t.prototype.getBranches=function(e,t,r,o,i,n,a){return __awaiter(this,void 0,void 0,function(){var s;return __generator(this,function(u){return s={alertType:r,continuationToken:o,branchNameContains:i,top:n,includePullRequestBranches:a},[2,this.beginRequest({apiVersion:"7.2-preview.1",routeTemplate:"{project}/_apis/Alert/repositories/{repository}/filters/{action}",routeValues:{project:e,repository:t,action:"Branches"},queryParams:s})]})})},t.prototype.getUxFilters=function(e,t,r){return __awaiter(this,void 0,void 0,function(){var o;return __generator(this,function(i){return o={alertType:r},[2,this.beginRequest({apiVersion:"7.2-preview.1",routeTemplate:"{project}/_apis/Alert/repositories/{repository}/filters/{action}",routeValues:{project:e,repository:t,action:"Default"},queryParams:o})]})})},t.prototype.getAlertInstances=function(e,t,r,o){return __awaiter(this,void 0,void 0,function(){var i;return __generator(this,function(n){return i={ref:o},[2,this.beginRequest({apiVersion:"7.2-preview.1",routeTemplate:"{project}/_apis/Alert/repositories/{repository}/alerts/{alertId}/Instances",routeValues:{project:e,alertId:t,repository:r},queryParams:i})]})})},t.prototype.createLegalReview=function(e,t,r,o){return __awaiter(this,void 0,void 0,function(){var i;return __generator(this,function(n){return i={alertId:r,ref:o},[2,this.beginRequest({apiVersion:"7.2-preview.1",method:"POST",routeTemplate:"{project}/_apis/Alert/repositories/{repository}/alerts/Metadata",routeValues:{project:e,repository:t},queryParams:i})]})})},t.prototype.updateAlertsMetadata=function(e,t,r){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(o){return[2,this.beginRequest({apiVersion:"7.2-preview.1",method:"PATCH",routeTemplate:"{project}/_apis/Alert/repositories/{repository}/alerts/Metadata",routeValues:{project:t,repository:r},body:e})]})})},t.prototype.getAlertMetadata=function(e,t,r){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(o){return[2,this.beginRequest({apiVersion:"7.2-preview.1",routeTemplate:"{project}/_apis/Alert/repositories/{repository}/alerts/{alertId}/metadata",routeValues:{project:e,alertId:t,repository:r}})]})})},t.prototype.getAlertMetadataBatch=function(e,t,r){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(o){return[2,this.beginRequest({apiVersion:"7.2-preview.1",method:"POST",routeTemplate:"{project}/_apis/Alert/repositories/{repository}/alerts/MetadataBatch",routeValues:{project:t,repository:r},body:e})]})})},t.prototype.getOrgLevelAlertsByIds=function(e){return __awaiter(this,void 0,void 0,function(){var t;return __generator(this,function(r){return t={alertIds:e&&e.join(",")},[2,this.beginRequest({apiVersion:"7.2-preview.1",routeTemplate:"_apis/Alert/alerts",queryParams:t})]})})},t.prototype.uploadSarif=function(e,t,r,o){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(i){return[2,this.beginRequest({apiVersion:"7.2-preview.1",method:"POST",routeTemplate:"{project}/_apis/Alert/repositories/{repository}/sarifs",routeValues:{project:t,repository:r},customHeaders:{"Content-Type":"application/octet-stream","X-AdvSec-NotificationSarif":o},body:e})]})})},t.prototype.getSarif=function(e){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(t){return[2,this.beginRequest({apiVersion:"7.2-preview.2",routeTemplate:"_apis/Alert/Sarifs/{sarifId}",routeValues:{sarifId:e}})]})})},t.prototype.uploadOrgSarif=function(e){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(t){return[2,this.beginRequest({apiVersion:"7.2-preview.2",method:"POST",routeTemplate:"_apis/Alert/Sarifs/{sarifId}",customHeaders:{"Content-Type":"application/octet-stream"},body:e})]})})},t.prototype.getValidityData=function(e,t,r){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(o){return[2,this.beginRequest({apiVersion:"7.2-preview.1",routeTemplate:"{project}/_apis/Alert/repositories/{repository}/alerts/{alertId}/Validate",routeValues:{project:e,repository:t,alertId:r}})]})})},t.prototype.initiateValidation=function(e,t,r){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(o){return[2,this.beginRequest({apiVersion:"7.2-preview.1",method:"POST",routeTemplate:"{project}/_apis/Alert/repositories/{repository}/alerts/{alertId}/Validate",routeValues:{project:e,repository:t,alertId:r}})]})})},t}(r.RestClientBase);t.AlertRestClient=i});
1
+ var __extends=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function o(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(o.prototype=r.prototype,new o)}}(),__awaiter=this&&this.__awaiter||function(e,t,r,o){return new(r||(r=Promise))(function(i,n){function a(e){try{u(o.next(e))}catch(e){n(e)}}function s(e){try{u(o.throw(e))}catch(e){n(e)}}function u(e){e.done?i(e.value):new r(function(t){t(e.value)}).then(a,s)}u((o=o.apply(e,t||[])).next())})},__generator=this&&this.__generator||function(e,t){function r(r){return function(a){return function(r){if(o)throw new TypeError("Generator is already executing.");for(;s;)try{if(o=1,i&&(n=2&r[0]?i.return:r[0]?i.throw||((n=i.return)&&n.call(i),0):i.next)&&!(n=n.call(i,r[1])).done)return n;switch(i=0,n&&(r=[2&r[0],n.value]),r[0]){case 0:case 1:n=r;break;case 4:return s.label++,{value:r[1],done:!1};case 5:s.label++,i=r[1],r=[0];continue;case 7:r=s.ops.pop(),s.trys.pop();continue;default:if(n=s.trys,!(n=n.length>0&&n[n.length-1])&&(6===r[0]||2===r[0])){s=0;continue}if(3===r[0]&&(!n||r[1]>n[0]&&r[1]<n[3])){s.label=r[1];break}if(6===r[0]&&s.label<n[1]){s.label=n[1],n=r;break}if(n&&s.label<n[2]){s.label=n[2],s.ops.push(r);break}n[2]&&s.ops.pop(),s.trys.pop();continue}r=t.call(e,s)}catch(e){r=[6,e],i=0}finally{o=n=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,a])}}var o,i,n,a,s={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return a={next:r(0),throw:r(1),return:r(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a};define(["require","exports","../Common/RestClientBase","../Common/Util/Serialization"],function(e,t,r,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(e){function t(t){return e.call(this,t)||this}return __extends(t,e),t.prototype.getAlert=function(e,t,r,o,i){return __awaiter(this,void 0,void 0,function(){var n;return __generator(this,function(a){return n={ref:o,expand:i},[2,this.beginRequest({apiVersion:"7.2-preview.1",routeTemplate:"{project}/_apis/Alert/repositories/{repository}/alerts/{alertId}",routeValues:{project:e,alertId:t,repository:r},queryParams:n})]})})},t.prototype.getAlerts=function(e,t,r,i,n,a,s){return __awaiter(this,void 0,void 0,function(){var u,p=this;return __generator(this,function(c){return u={top:r,orderBy:i,criteria:n,expand:a,continuationToken:s},[2,this.beginRequest({apiVersion:"7.2-preview.1",routeTemplate:"{project}/_apis/Alert/repositories/{repository}/alerts/{alertId}",routeValues:{project:e,repository:t},queryParams:u,returnRawResponse:!0}).then(function(e){return __awaiter(p,void 0,void 0,function(){var t;return __generator(this,function(r){switch(r.label){case 0:return[4,e.text().then(o.deserializeVssJsonObject)];case 1:return t=r.sent(),t.continuationToken=e.headers.get("x-ms-continuationtoken"),[2,t]}})})})]})})},t.prototype.getAlertSarif=function(e,t,r,o,i){return __awaiter(this,void 0,void 0,function(){var n;return __generator(this,function(a){return n={ref:o,expand:i},[2,this.beginRequest({apiVersion:"7.2-preview.1",routeTemplate:"{project}/_apis/Alert/repositories/{repository}/alerts/{alertId}",routeValues:{project:e,alertId:t,repository:r},queryParams:n})]})})},t.prototype.updateAlert=function(e,t,r,o){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(i){return[2,this.beginRequest({apiVersion:"7.2-preview.1",method:"PATCH",routeTemplate:"{project}/_apis/Alert/repositories/{repository}/alerts/{alertId}",routeValues:{project:t,alertId:r,repository:o},body:e})]})})},t.prototype.getAlertsByIds=function(e,t,r){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(o){return[2,this.beginRequest({apiVersion:"7.2-preview.1",method:"POST",routeTemplate:"{project}/_apis/Alert/repositories/{repository}/AlertsBatch",routeValues:{project:t,repository:r},body:e})]})})},t.prototype.getBranches=function(e,t,r,o,i,n,a){return __awaiter(this,void 0,void 0,function(){var s;return __generator(this,function(u){return s={alertType:r,continuationToken:o,branchNameContains:i,top:n,includePullRequestBranches:a},[2,this.beginRequest({apiVersion:"7.2-preview.1",routeTemplate:"{project}/_apis/Alert/repositories/{repository}/filters/{action}",routeValues:{project:e,repository:t,action:"Branches"},queryParams:s})]})})},t.prototype.getUxFilters=function(e,t,r){return __awaiter(this,void 0,void 0,function(){var o;return __generator(this,function(i){return o={alertType:r},[2,this.beginRequest({apiVersion:"7.2-preview.1",routeTemplate:"{project}/_apis/Alert/repositories/{repository}/filters/{action}",routeValues:{project:e,repository:t,action:"Default"},queryParams:o})]})})},t.prototype.getAlertInstances=function(e,t,r,o){return __awaiter(this,void 0,void 0,function(){var i;return __generator(this,function(n){return i={ref:o},[2,this.beginRequest({apiVersion:"7.2-preview.1",routeTemplate:"{project}/_apis/Alert/repositories/{repository}/alerts/{alertId}/Instances",routeValues:{project:e,alertId:t,repository:r},queryParams:i})]})})},t.prototype.createLegalReview=function(e,t,r,o){return __awaiter(this,void 0,void 0,function(){var i;return __generator(this,function(n){return i={alertId:r,ref:o},[2,this.beginRequest({apiVersion:"7.2-preview.1",method:"POST",routeTemplate:"{project}/_apis/Alert/repositories/{repository}/alerts/Metadata",routeValues:{project:e,repository:t},queryParams:i})]})})},t.prototype.updateAlertsMetadata=function(e,t,r){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(o){return[2,this.beginRequest({apiVersion:"7.2-preview.1",method:"PATCH",routeTemplate:"{project}/_apis/Alert/repositories/{repository}/alerts/Metadata",routeValues:{project:t,repository:r},body:e})]})})},t.prototype.getAlertMetadata=function(e,t,r){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(o){return[2,this.beginRequest({apiVersion:"7.2-preview.1",routeTemplate:"{project}/_apis/Alert/repositories/{repository}/alerts/{alertId}/metadata",routeValues:{project:e,alertId:t,repository:r}})]})})},t.prototype.getAlertMetadataBatch=function(e,t,r){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(o){return[2,this.beginRequest({apiVersion:"7.2-preview.1",method:"POST",routeTemplate:"{project}/_apis/Alert/repositories/{repository}/alerts/MetadataBatch",routeValues:{project:t,repository:r},body:e})]})})},t.prototype.getOrgLevelAlertsByIds=function(e){return __awaiter(this,void 0,void 0,function(){var t;return __generator(this,function(r){return t={alertIds:e&&e.join(",")},[2,this.beginRequest({apiVersion:"7.2-preview.1",routeTemplate:"_apis/Alert/alerts",queryParams:t})]})})},t.prototype.uploadSarif=function(e,t,r,o){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(i){return[2,this.beginRequest({apiVersion:"7.2-preview.1",method:"POST",routeTemplate:"{project}/_apis/Alert/repositories/{repository}/sarifs",routeValues:{project:t,repository:r},customHeaders:{"Content-Type":"application/octet-stream","X-AdvSec-NotificationSarif":o},body:e})]})})},t.prototype.getSarif=function(e){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(t){return[2,this.beginRequest({apiVersion:"7.2-preview.2",routeTemplate:"_apis/Alert/Sarifs/{sarifId}",routeValues:{sarifId:e}})]})})},t.prototype.uploadOrgSarif=function(e){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(t){return[2,this.beginRequest({apiVersion:"7.2-preview.2",method:"POST",routeTemplate:"_apis/Alert/Sarifs/{sarifId}",customHeaders:{"Content-Type":"application/octet-stream"},body:e})]})})},t.prototype.getValidityData=function(e,t,r){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(o){return[2,this.beginRequest({apiVersion:"7.2-preview.1",routeTemplate:"{project}/_apis/Alert/repositories/{repository}/alerts/{alertId}/Validate",routeValues:{project:e,repository:t,alertId:r}})]})})},t.prototype.initiateValidation=function(e,t,r){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(o){return[2,this.beginRequest({apiVersion:"7.2-preview.1",method:"POST",routeTemplate:"{project}/_apis/Alert/repositories/{repository}/alerts/{alertId}/Validate",routeValues:{project:e,repository:t,alertId:r}})]})})},t}(r.RestClientBase);t.AlertRestClient=i});
@@ -5,7 +5,7 @@ export interface AdvSecEnablementFeatures {
5
5
  */
6
6
  autoEnableNewProjectOrRepos: boolean;
7
7
  /**
8
- * CodeQL enablement status set to False when disabled and True when enabled; Null is never explicitly set.
8
+ * CodeQL default setup enablement status set to False when not using default setup and True when using default setup; Null is never explicitly set.
9
9
  */
10
10
  codeQLEnabled: boolean;
11
11
  /**
@@ -195,7 +195,7 @@ export interface BulkEnablementSettingsBase {
195
195
  }
196
196
  export interface CodeSecurityFeatures {
197
197
  /**
198
- * CodeQL enablement status set to False when disabled and True when enabled; Null is never explicitly set.
198
+ * CodeQL default setup enablement status set to False when not using default setup and True when using default setup; Null is never explicitly set.
199
199
  */
200
200
  codeQLEnabled: boolean;
201
201
  /**