azure-devops-extension-api 5.274.0 → 5.276.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.
Files changed (45) hide show
  1. package/AdvancedSecurity.Reporting/Reporting.d.ts +10 -2
  2. package/AdvancedSecurity.Reporting/Reporting.js +8 -0
  3. package/AdvancedSecurity.Reporting/Reporting.min.js +1 -1
  4. package/Alert/Alert.d.ts +143 -5
  5. package/Alert/Alert.js +60 -1
  6. package/Alert/Alert.min.js +1 -1
  7. package/Alert/AlertClient.d.ts +26 -3
  8. package/Alert/AlertClient.js +75 -5
  9. package/Alert/AlertClient.min.js +1 -1
  10. package/Build/Build.d.ts +19 -15
  11. package/Git/Git.d.ts +17 -1
  12. package/Git/GitClient.d.ts +10 -3
  13. package/Git/GitClient.js +23 -3
  14. package/Git/GitClient.min.js +1 -1
  15. package/Management/Management.d.ts +18 -2
  16. package/Management/Management.js +4 -0
  17. package/Management/Management.min.js +1 -1
  18. package/TaskAgent/TaskAgent.d.ts +11 -1
  19. package/Test/Test.d.ts +44 -0
  20. package/TestResults/TestResultsClient.d.ts +44 -0
  21. package/TestResults/TestResultsClient.js +116 -0
  22. package/TestResults/TestResultsClient.min.js +1 -1
  23. package/esm/AdvancedSecurity.Reporting/Reporting.js +8 -0
  24. package/esm/AdvancedSecurity.Reporting/Reporting.min.js +1 -1
  25. package/esm/Alert/Alert.js +59 -0
  26. package/esm/Alert/Alert.min.js +1 -1
  27. package/esm/Alert/AlertClient.js +69 -5
  28. package/esm/Alert/AlertClient.min.js +1 -1
  29. package/esm/Git/GitClient.js +21 -3
  30. package/esm/Git/GitClient.min.js +1 -1
  31. package/esm/Management/Management.js +4 -0
  32. package/esm/Management/Management.min.js +1 -1
  33. package/esm/TestResults/TestResultsClient.js +106 -0
  34. package/esm/TestResults/TestResultsClient.min.js +1 -1
  35. package/package.json +1 -1
  36. package/_manifest/comparison-result.json +0 -40
  37. package/_manifest/spdx_2.2/ESRPClientLogs0702203431812.json +0 -1
  38. package/_manifest/spdx_2.2/bsi.cose +0 -0
  39. package/_manifest/spdx_2.2/bsi.json +0 -1
  40. package/_manifest/spdx_2.2/manifest.cat +0 -0
  41. package/_manifest/spdx_2.2/manifest.spdx.cose +0 -0
  42. package/_manifest/spdx_2.2/manifest.spdx.json +0 -1
  43. package/_manifest/spdx_2.2/manifest.spdx.json.sha256 +0 -1
  44. package/_manifest/spdx_3.0/manifest.spdx.json +0 -1
  45. package/_manifest/spdx_3.0/manifest.spdx.json.sha256 +0 -1
@@ -124,7 +124,11 @@ export declare enum AlertType {
124
124
  /**
125
125
  * The code uses a dependency with potential license incompliance.
126
126
  */
127
- License = 4
127
+ License = 4,
128
+ /**
129
+ * The code contains a weakness determined by AI-powered analysis.
130
+ */
131
+ AICode = 5
128
132
  }
129
133
  export declare enum AlertValidityStatus {
130
134
  /**
@@ -705,7 +709,11 @@ export declare enum State {
705
709
  /**
706
710
  * The tool has determined that the issue is no longer a risk
707
711
  */
708
- AutoDismissed = 8
712
+ AutoDismissed = 8,
713
+ /**
714
+ * Alert is in a draft state and is only visible to identities in the Advanced Security draft-alert privileged identity list. Filtered out of all Get alert responses (results and counts) for non-privileged callers.
715
+ */
716
+ Draft = 16
709
717
  }
710
718
  export declare enum TimePeriod {
711
719
  Undefined = 0,
@@ -28,6 +28,10 @@ var AlertType;
28
28
  * The code uses a dependency with potential license incompliance.
29
29
  */
30
30
  AlertType[AlertType["License"] = 4] = "License";
31
+ /**
32
+ * The code contains a weakness determined by AI-powered analysis.
33
+ */
34
+ AlertType[AlertType["AICode"] = 5] = "AICode";
31
35
  })(AlertType || (exports.AlertType = AlertType = {}));
32
36
  var AlertValidityStatus;
33
37
  (function (AlertValidityStatus) {
@@ -191,6 +195,10 @@ var State;
191
195
  * The tool has determined that the issue is no longer a risk
192
196
  */
193
197
  State[State["AutoDismissed"] = 8] = "AutoDismissed";
198
+ /**
199
+ * Alert is in a draft state and is only visible to identities in the Advanced Security draft-alert privileged identity list. Filtered out of all Get alert responses (results and counts) for non-privileged callers.
200
+ */
201
+ State[State["Draft"] = 16] = "Draft";
194
202
  })(State || (exports.State = State = {}));
195
203
  var TimePeriod;
196
204
  (function (TimePeriod) {
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.TimePeriod=exports.State=exports.Severity=exports.DismissalType=exports.DashboardAlertState=exports.ComponentType=exports.AlertValidityStatus=exports.AlertType=void 0;var AlertType;!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"}(AlertType||(exports.AlertType=AlertType={}));var AlertValidityStatus;!function(e){e[e.None=0]="None",e[e.Unknown=1]="Unknown",e[e.Active=2]="Active",e[e.Inactive=3]="Inactive"}(AlertValidityStatus||(exports.AlertValidityStatus=AlertValidityStatus={}));var ComponentType;!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"}(ComponentType||(exports.ComponentType=ComponentType={}));var DashboardAlertState;!function(e){e[e.Open=0]="Open",e[e.Closed=1]="Closed"}(DashboardAlertState||(exports.DashboardAlertState=DashboardAlertState={}));var DismissalType;!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"}(DismissalType||(exports.DismissalType=DismissalType={}));var Severity;!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"}(Severity||(exports.Severity=Severity={}));var State;!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"}(State||(exports.State=State={}));var TimePeriod;!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"}(TimePeriod||(exports.TimePeriod=TimePeriod={}));
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.TimePeriod=exports.State=exports.Severity=exports.DismissalType=exports.DashboardAlertState=exports.ComponentType=exports.AlertValidityStatus=exports.AlertType=void 0;var AlertType;!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",e[e.AICode=5]="AICode"}(AlertType||(exports.AlertType=AlertType={}));var AlertValidityStatus;!function(e){e[e.None=0]="None",e[e.Unknown=1]="Unknown",e[e.Active=2]="Active",e[e.Inactive=3]="Inactive"}(AlertValidityStatus||(exports.AlertValidityStatus=AlertValidityStatus={}));var ComponentType;!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"}(ComponentType||(exports.ComponentType=ComponentType={}));var DashboardAlertState;!function(e){e[e.Open=0]="Open",e[e.Closed=1]="Closed"}(DashboardAlertState||(exports.DashboardAlertState=DashboardAlertState={}));var DismissalType;!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"}(DismissalType||(exports.DismissalType=DismissalType={}));var Severity;!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"}(Severity||(exports.Severity=Severity={}));var State;!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",e[e.Draft=16]="Draft"}(State||(exports.State=State={}));var TimePeriod;!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"}(TimePeriod||(exports.TimePeriod=TimePeriod={}));
package/Alert/Alert.d.ts CHANGED
@@ -1,11 +1,28 @@
1
1
  import * as WebApi from "../WebApi/WebApi";
2
+ /**
3
+ * Reference to the AI metadata blob associated with an AI code alert. Allows a consumer to download the full metadata blob. No querying over the blob contents is supported.
4
+ */
5
+ export interface AIMetadataBlobReference {
6
+ /**
7
+ * URL to download the full AI metadata blob.
8
+ */
9
+ downloadUrl: string;
10
+ }
2
11
  export interface Alert {
12
+ /**
13
+ * Additional information message to display for this alert. For ASAN tools, contains crash details formatted in code blocks. For AI code scanning tools, contains markdown content from result.message.markdown.
14
+ */
15
+ additionalInformationMessage: string;
3
16
  /**
4
17
  * Additional properties of this alert.
5
18
  */
6
19
  additionalProperties: {
7
20
  [key: string]: any;
8
21
  };
22
+ /**
23
+ * Reference to the AI metadata blob associated with the alert (AI code alerts only). Only returned on demand in Get API with Expand parameter set to be AIMetadataBlobReference (not returned in List API).
24
+ */
25
+ aiMetadataBlobReference: AIMetadataBlobReference;
9
26
  /**
10
27
  * Identifier for the alert. It is unique within Azure DevOps organization.
11
28
  */
@@ -46,6 +63,10 @@ export interface Alert {
46
63
  * Value indicates whether the alert can be auto-fixed by Copilot Autofix. True when the alert is a code scanning alert detected by CodeQL with a supported rule. Null when the value has not been computed for this code path.
47
64
  */
48
65
  isAutoFixable: boolean;
66
+ /**
67
+ * Value indicates whether the alert was generated for a development dependency. True indicates development dependency, false indicates runtime dependency, and null indicates unknown or not applicable.
68
+ */
69
+ isDevDependency: boolean;
49
70
  /**
50
71
  * This value is computed and returned by the service. This value represents the last time the service has seen this issue reported in an analysis instance.
51
72
  */
@@ -145,6 +166,19 @@ export interface AlertBatchRequest {
145
166
  */
146
167
  alertType: AlertType;
147
168
  }
169
+ /**
170
+ * Request model for batch-updating alert states.
171
+ */
172
+ export interface AlertBatchStateUpdateRequest {
173
+ /**
174
+ * The list of individual alert state changes to apply. Max 100 items per request.
175
+ */
176
+ alertStateUpdateList: AlertStateUpdateForAlert[];
177
+ /**
178
+ * The alert type of the alerts being updated. Defaults to AICode if not specified.
179
+ */
180
+ alertType: AlertType;
181
+ }
148
182
  export declare enum AlertListExpandOption {
149
183
  /**
150
184
  * No Expands.
@@ -216,6 +250,27 @@ export interface AlertStateUpdate {
216
250
  dismissedReason: DismissalType;
217
251
  state: State;
218
252
  }
253
+ /**
254
+ * Represents a state update for a single alert within a batch request.
255
+ */
256
+ export interface AlertStateUpdateForAlert {
257
+ /**
258
+ * The ID of the alert to update.
259
+ */
260
+ alertId: number;
261
+ /**
262
+ * Comment for dismissal (e.g., "Dismissed by AI scan validation").
263
+ */
264
+ dismissedComment: string;
265
+ /**
266
+ * Reason for dismissal. Required when State == Dismissed.
267
+ */
268
+ dismissedReason: DismissalType;
269
+ /**
270
+ * The state to transition the alert to (Active, Dismissed, or Draft). Draft means the alert is indeterminate and should remain in its current state.
271
+ */
272
+ state: State;
273
+ }
219
274
  export declare enum AlertType {
220
275
  /**
221
276
  * The code has an unspecified vulnerability type
@@ -236,7 +291,11 @@ export declare enum AlertType {
236
291
  /**
237
292
  * The code uses a dependency with potential license incompliance.
238
293
  */
239
- License = 4
294
+ License = 4,
295
+ /**
296
+ * The code contains a weakness determined by AI-powered analysis.
297
+ */
298
+ AICode = 5
240
299
  }
241
300
  export declare enum AlertValidationRequestStatus {
242
301
  /**
@@ -399,12 +458,24 @@ export interface AnalysisResult {
399
458
  * Payload sent by the autofix pipeline to report the outcome of a run.
400
459
  */
401
460
  export interface AutofixCallbackRequest {
461
+ /**
462
+ * Optional diagnostic detail captured by the pipeline when the run fails — the tail of the pipeline run log (where the failing step's output is), bounded by the pipeline to fit the trace message size limit. Null or empty for successful runs or when no output was captured.
463
+ */
464
+ errorDetails: string;
465
+ /**
466
+ * Orchestration plan id (System.PlanId) of the pipeline run reporting this callback.
467
+ */
468
+ pipelinePlanId: string;
402
469
  pullRequestId: number;
403
470
  requestId: number;
404
471
  /**
405
472
  * Terminal status reported by the pipeline.
406
473
  */
407
474
  status: AutofixCallbackStatus;
475
+ /**
476
+ * Total nanoAIU consumed by the autofix binary.
477
+ */
478
+ tokenUsage: number;
408
479
  }
409
480
  export declare enum AutofixCallbackStatus {
410
481
  /**
@@ -414,16 +485,51 @@ export declare enum AutofixCallbackStatus {
414
485
  /**
415
486
  * The pipeline or post-processing failed.
416
487
  */
417
- Failed = 1
488
+ Failed = 1,
489
+ /**
490
+ * The pipeline completed successfully but the autofix binary produced no changes, so no pull request was created.
491
+ */
492
+ NoChangesProduced = 2
418
493
  }
419
494
  /**
420
495
  * Represents an autofix request resource.
421
496
  */
422
497
  export interface AutofixRequest {
423
498
  createdDate: Date;
499
+ failedReason: AutofixRequestFailedReason;
500
+ pipelinePlanId: string;
424
501
  requestId: number;
425
502
  status: AutofixRequestStatus;
426
503
  }
504
+ /**
505
+ * Indicates the reason an autofix request failed. Maps to TINYINT (nullable) in the database.
506
+ */
507
+ export declare enum AutofixRequestFailedReason {
508
+ /**
509
+ * Default sentinel value; not a valid failure reason.
510
+ */
511
+ None = 0,
512
+ /**
513
+ * The autofix pipeline run completed with a failure status.
514
+ */
515
+ PipelineFailed = 1,
516
+ /**
517
+ * The autofix pipeline did not complete within the allowed time window.
518
+ */
519
+ PipelineTimedOut = 2,
520
+ /**
521
+ * The expected callback from the pipeline was never received.
522
+ */
523
+ CallbackNotReceived = 3,
524
+ /**
525
+ * The processor job encountered an error.
526
+ */
527
+ ProcessorJobFailed = 4,
528
+ /**
529
+ * The pipeline completed successfully but produced no changes, so no pull request was created. A valid terminal outcome surfaced as a failure with this distinct reason.
530
+ */
531
+ NoChanges = 5
532
+ }
427
533
  /**
428
534
  * Indicates the lifecycle status of an autofix request. Maps to TINYINT in the database.
429
535
  */
@@ -596,6 +702,10 @@ export interface DependencyResult {
596
702
  */
597
703
  versionControlFilePath: VersionControlFilePath;
598
704
  }
705
+ export declare enum DependencyScope {
706
+ Runtime = 0,
707
+ Development = 1
708
+ }
599
709
  /**
600
710
  * Information about an alert dismissal
601
711
  */
@@ -660,7 +770,11 @@ export declare enum ExpandOption {
660
770
  /**
661
771
  * Return validationFingerprints in Alert.
662
772
  */
663
- ValidationFingerprint = 1
773
+ ValidationFingerprint = 1,
774
+ /**
775
+ * Return the AI metadata blob reference in Alert.
776
+ */
777
+ AIMetadataBlobReference = 2
664
778
  }
665
779
  /**
666
780
  * Details for a legal review for a given component
@@ -1011,7 +1125,15 @@ export declare enum SarifJobStatus {
1011
1125
  /**
1012
1126
  * The job is currently being processed in the concurrent processing workflow exclusive for no autofix flows
1013
1127
  */
1014
- ConcurrentProcessing = 5
1128
+ ConcurrentProcessing = 5,
1129
+ /**
1130
+ * The original AI SARIF has been superseded by a consolidated SARIF (AI alert consolidation experiment). Terminal status: the original is never processed for alerts and is never re-consolidated.
1131
+ */
1132
+ Consolidated = 6,
1133
+ /**
1134
+ * An original AI SARIF awaiting consolidation (AI alert consolidation experiment). Excluded from normal alert processing; selected by the consolidation job, which moves it to Consolidated once it has launched the consolidation pipeline.
1135
+ */
1136
+ WaitingConsolidation = 7
1015
1137
  }
1016
1138
  export interface SarifUploadStatus {
1017
1139
  errors: SarifValidationError[];
@@ -1039,6 +1161,10 @@ export interface SearchCriteria {
1039
1161
  * If provided, only alerts for this dependency are returned. \<br /\>Otherwise, return alerts for all dependencies. \<br /\>In a sarif submission, a dependency (or a component) is specified in result.RelatedLocations[].logicalLocation. \<br /\>Not applicable for secret alerts.
1040
1162
  */
1041
1163
  dependencyName: string;
1164
+ /**
1165
+ * If provided, only alerts for dependencies in this scope are returned. \<br /\>Otherwise, return alerts regardless of scope. \<br /\>Only applicable for dependency alerts.
1166
+ */
1167
+ dependencyScope: DependencyScope;
1042
1168
  /**
1043
1169
  * If provided, only return alerts last seen after this date. \<br /\>Otherwise return all alerts.
1044
1170
  */
@@ -1111,6 +1237,10 @@ export interface SearchCriteria {
1111
1237
  * If provided with toolName, only return alerts detected by this tool. \<br /\>Otherwise, return alerts detected by all tools.
1112
1238
  */
1113
1239
  toolName: string;
1240
+ /**
1241
+ * If provided, only return alerts detected by these tools. \<br /\>Takes precedence over ToolName when populated. \<br /\>Requires the EnableMultiToolSelection feature flag.
1242
+ */
1243
+ toolNames: string[];
1114
1244
  /**
1115
1245
  * If provided, only return alerts with the validity specified here. If the validity status is Unknown, fetch alerts of all validity results. \<br /\>Only applicable for secret alerts. \<br /\>Filtering by validity status may cause less alerts to be returned than requested with TOP parameter. \<br /\>Due to this behavior, the ContinuationToken(\<![CDATA[\<header name\>]]\>) in the response header should be relied on to decide if another batch needs to be fetched.
1116
1246
  */
@@ -1146,12 +1276,20 @@ export declare enum State {
1146
1276
  /**
1147
1277
  * The tool has determined that the issue is no longer a risk
1148
1278
  */
1149
- AutoDismissed = 8
1279
+ AutoDismissed = 8,
1280
+ /**
1281
+ * Alert is in a draft state and is only visible to identities in the Advanced Security draft-alert privileged identity list. Filtered out of all Get alert responses (results and counts) for non-privileged callers.
1282
+ */
1283
+ Draft = 16
1150
1284
  }
1151
1285
  /**
1152
1286
  * An Analysis tool that can generate security alerts
1153
1287
  */
1154
1288
  export interface Tool {
1289
+ /**
1290
+ * Whether the tool produces deterministic results. Used to group tools in the alerts filter UI.
1291
+ */
1292
+ isDeterministic: boolean;
1155
1293
  /**
1156
1294
  * Name of the tool
1157
1295
  */
package/Alert/Alert.js CHANGED
@@ -5,7 +5,7 @@
5
5
  * ---------------------------------------------------------
6
6
  */
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
- exports.ValidationResult = exports.State = exports.Severity = exports.SarifJobStatus = exports.ResultType = exports.MetadataOperation = exports.MetadataChangeType = exports.LicenseType = exports.LicenseState = exports.ExpandOption = exports.DismissalType = exports.DependencyKind = exports.Confidence = exports.ComponentType = exports.AutofixRequestStatus = exports.AutofixCallbackStatus = exports.AnalysisConfigurationType = exports.AlertValidityStatus = exports.AlertValidationRequestStatus = exports.AlertType = exports.AlertMetadataErrorPolicy = exports.AlertListExpandOption = void 0;
8
+ exports.ValidationResult = exports.State = exports.Severity = exports.SarifJobStatus = exports.ResultType = exports.MetadataOperation = exports.MetadataChangeType = exports.LicenseType = exports.LicenseState = exports.ExpandOption = exports.DismissalType = exports.DependencyScope = exports.DependencyKind = exports.Confidence = exports.ComponentType = exports.AutofixRequestStatus = exports.AutofixRequestFailedReason = exports.AutofixCallbackStatus = exports.AnalysisConfigurationType = exports.AlertValidityStatus = exports.AlertValidationRequestStatus = exports.AlertType = exports.AlertMetadataErrorPolicy = exports.AlertListExpandOption = void 0;
9
9
  var AlertListExpandOption;
10
10
  (function (AlertListExpandOption) {
11
11
  /**
@@ -57,6 +57,10 @@ var AlertType;
57
57
  * The code uses a dependency with potential license incompliance.
58
58
  */
59
59
  AlertType[AlertType["License"] = 4] = "License";
60
+ /**
61
+ * The code contains a weakness determined by AI-powered analysis.
62
+ */
63
+ AlertType[AlertType["AICode"] = 5] = "AICode";
60
64
  })(AlertType || (exports.AlertType = AlertType = {}));
61
65
  var AlertValidationRequestStatus;
62
66
  (function (AlertValidationRequestStatus) {
@@ -121,7 +125,41 @@ var AutofixCallbackStatus;
121
125
  * The pipeline or post-processing failed.
122
126
  */
123
127
  AutofixCallbackStatus[AutofixCallbackStatus["Failed"] = 1] = "Failed";
128
+ /**
129
+ * The pipeline completed successfully but the autofix binary produced no changes, so no pull request was created.
130
+ */
131
+ AutofixCallbackStatus[AutofixCallbackStatus["NoChangesProduced"] = 2] = "NoChangesProduced";
124
132
  })(AutofixCallbackStatus || (exports.AutofixCallbackStatus = AutofixCallbackStatus = {}));
133
+ /**
134
+ * Indicates the reason an autofix request failed. Maps to TINYINT (nullable) in the database.
135
+ */
136
+ var AutofixRequestFailedReason;
137
+ (function (AutofixRequestFailedReason) {
138
+ /**
139
+ * Default sentinel value; not a valid failure reason.
140
+ */
141
+ AutofixRequestFailedReason[AutofixRequestFailedReason["None"] = 0] = "None";
142
+ /**
143
+ * The autofix pipeline run completed with a failure status.
144
+ */
145
+ AutofixRequestFailedReason[AutofixRequestFailedReason["PipelineFailed"] = 1] = "PipelineFailed";
146
+ /**
147
+ * The autofix pipeline did not complete within the allowed time window.
148
+ */
149
+ AutofixRequestFailedReason[AutofixRequestFailedReason["PipelineTimedOut"] = 2] = "PipelineTimedOut";
150
+ /**
151
+ * The expected callback from the pipeline was never received.
152
+ */
153
+ AutofixRequestFailedReason[AutofixRequestFailedReason["CallbackNotReceived"] = 3] = "CallbackNotReceived";
154
+ /**
155
+ * The processor job encountered an error.
156
+ */
157
+ AutofixRequestFailedReason[AutofixRequestFailedReason["ProcessorJobFailed"] = 4] = "ProcessorJobFailed";
158
+ /**
159
+ * The pipeline completed successfully but produced no changes, so no pull request was created. A valid terminal outcome surfaced as a failure with this distinct reason.
160
+ */
161
+ AutofixRequestFailedReason[AutofixRequestFailedReason["NoChanges"] = 5] = "NoChanges";
162
+ })(AutofixRequestFailedReason || (exports.AutofixRequestFailedReason = AutofixRequestFailedReason = {}));
125
163
  /**
126
164
  * Indicates the lifecycle status of an autofix request. Maps to TINYINT in the database.
127
165
  */
@@ -243,6 +281,11 @@ var DependencyKind;
243
281
  */
244
282
  DependencyKind[DependencyKind["VulnerableDependency"] = 3] = "VulnerableDependency";
245
283
  })(DependencyKind || (exports.DependencyKind = DependencyKind = {}));
284
+ var DependencyScope;
285
+ (function (DependencyScope) {
286
+ DependencyScope[DependencyScope["Runtime"] = 0] = "Runtime";
287
+ DependencyScope[DependencyScope["Development"] = 1] = "Development";
288
+ })(DependencyScope || (exports.DependencyScope = DependencyScope = {}));
246
289
  var DismissalType;
247
290
  (function (DismissalType) {
248
291
  /**
@@ -284,6 +327,10 @@ var ExpandOption;
284
327
  * Return validationFingerprints in Alert.
285
328
  */
286
329
  ExpandOption[ExpandOption["ValidationFingerprint"] = 1] = "ValidationFingerprint";
330
+ /**
331
+ * Return the AI metadata blob reference in Alert.
332
+ */
333
+ ExpandOption[ExpandOption["AIMetadataBlobReference"] = 2] = "AIMetadataBlobReference";
287
334
  })(ExpandOption || (exports.ExpandOption = ExpandOption = {}));
288
335
  var LicenseState;
289
336
  (function (LicenseState) {
@@ -406,6 +453,14 @@ var SarifJobStatus;
406
453
  * The job is currently being processed in the concurrent processing workflow exclusive for no autofix flows
407
454
  */
408
455
  SarifJobStatus[SarifJobStatus["ConcurrentProcessing"] = 5] = "ConcurrentProcessing";
456
+ /**
457
+ * The original AI SARIF has been superseded by a consolidated SARIF (AI alert consolidation experiment). Terminal status: the original is never processed for alerts and is never re-consolidated.
458
+ */
459
+ SarifJobStatus[SarifJobStatus["Consolidated"] = 6] = "Consolidated";
460
+ /**
461
+ * An original AI SARIF awaiting consolidation (AI alert consolidation experiment). Excluded from normal alert processing; selected by the consolidation job, which moves it to Consolidated once it has launched the consolidation pipeline.
462
+ */
463
+ SarifJobStatus[SarifJobStatus["WaitingConsolidation"] = 7] = "WaitingConsolidation";
409
464
  })(SarifJobStatus || (exports.SarifJobStatus = SarifJobStatus = {}));
410
465
  var Severity;
411
466
  (function (Severity) {
@@ -440,6 +495,10 @@ var State;
440
495
  * The tool has determined that the issue is no longer a risk
441
496
  */
442
497
  State[State["AutoDismissed"] = 8] = "AutoDismissed";
498
+ /**
499
+ * Alert is in a draft state and is only visible to identities in the Advanced Security draft-alert privileged identity list. Filtered out of all Get alert responses (results and counts) for non-privileged callers.
500
+ */
501
+ State[State["Draft"] = 16] = "Draft";
443
502
  })(State || (exports.State = State = {}));
444
503
  var ValidationResult;
445
504
  (function (ValidationResult) {
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ValidationResult=exports.State=exports.Severity=exports.SarifJobStatus=exports.ResultType=exports.MetadataOperation=exports.MetadataChangeType=exports.LicenseType=exports.LicenseState=exports.ExpandOption=exports.DismissalType=exports.DependencyKind=exports.Confidence=exports.ComponentType=exports.AutofixRequestStatus=exports.AutofixCallbackStatus=exports.AnalysisConfigurationType=exports.AlertValidityStatus=exports.AlertValidationRequestStatus=exports.AlertType=exports.AlertMetadataErrorPolicy=exports.AlertListExpandOption=void 0;var AlertListExpandOption;!function(e){e[e.None=0]="None",e[e.Minimal=1]="Minimal",e[e.Count=2]="Count"}(AlertListExpandOption||(exports.AlertListExpandOption=AlertListExpandOption={}));var AlertMetadataErrorPolicy;!function(e){e[e.Fail=1]="Fail",e[e.Omit=2]="Omit"}(AlertMetadataErrorPolicy||(exports.AlertMetadataErrorPolicy=AlertMetadataErrorPolicy={}));var AlertType;!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"}(AlertType||(exports.AlertType=AlertType={}));var AlertValidationRequestStatus;!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"}(AlertValidationRequestStatus||(exports.AlertValidationRequestStatus=AlertValidationRequestStatus={}));var AlertValidityStatus;!function(e){e[e.None=0]="None",e[e.Unknown=1]="Unknown",e[e.Active=2]="Active",e[e.Inactive=3]="Inactive"}(AlertValidityStatus||(exports.AlertValidityStatus=AlertValidityStatus={}));var AnalysisConfigurationType;!function(e){e[e.Default=0]="Default",e[e.AdoPipeline=1]="AdoPipeline"}(AnalysisConfigurationType||(exports.AnalysisConfigurationType=AnalysisConfigurationType={}));var AutofixCallbackStatus;!function(e){e[e.Done=0]="Done",e[e.Failed=1]="Failed"}(AutofixCallbackStatus||(exports.AutofixCallbackStatus=AutofixCallbackStatus={}));var AutofixRequestStatus;!function(e){e[e.None=0]="None",e[e.Pending=1]="Pending",e[e.PipelineRunning=2]="PipelineRunning",e[e.Done=3]="Done",e[e.Failed=4]="Failed"}(AutofixRequestStatus||(exports.AutofixRequestStatus=AutofixRequestStatus={}));var ComponentType;!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"}(ComponentType||(exports.ComponentType=ComponentType={}));var Confidence;!function(e){e[e.High=0]="High",e[e.Other=1]="Other"}(Confidence||(exports.Confidence=Confidence={}));var DependencyKind;!function(e){e[e.Unknown=0]="Unknown",e[e.RootDependency=1]="RootDependency",e[e.Component=2]="Component",e[e.VulnerableDependency=3]="VulnerableDependency"}(DependencyKind||(exports.DependencyKind=DependencyKind={}));var DismissalType;!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"}(DismissalType||(exports.DismissalType=DismissalType={}));var ExpandOption;!function(e){e[e.None=0]="None",e[e.ValidationFingerprint=1]="ValidationFingerprint"}(ExpandOption||(exports.ExpandOption=ExpandOption={}));var LicenseState;!function(e){e[e.Unknown=0]="Unknown",e[e.NotHarvested=1]="NotHarvested",e[e.Harvested=2]="Harvested"}(LicenseState||(exports.LicenseState=LicenseState={}));var LicenseType;!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"}(LicenseType||(exports.LicenseType=LicenseType={}));var MetadataChangeType;!function(e){e[e.None=0]="None",e[e.Created=1]="Created",e[e.Updated=2]="Updated",e[e.Deleted=3]="Deleted"}(MetadataChangeType||(exports.MetadataChangeType=MetadataChangeType={}));var MetadataOperation;!function(e){e[e.None=0]="None",e[e.Add=1]="Add",e[e.Remove=2]="Remove"}(MetadataOperation||(exports.MetadataOperation=MetadataOperation={}));var ResultType;!function(e){e[e.Unknown=0]="Unknown",e[e.Dependency=1]="Dependency",e[e.VersionControl=2]="VersionControl"}(ResultType||(exports.ResultType=ResultType={}));var SarifJobStatus;!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",e[e.ConcurrentProcessing=5]="ConcurrentProcessing"}(SarifJobStatus||(exports.SarifJobStatus=SarifJobStatus={}));var Severity;!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"}(Severity||(exports.Severity=Severity={}));var State;!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"}(State||(exports.State=State={}));var ValidationResult;!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"}(ValidationResult||(exports.ValidationResult=ValidationResult={}));
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ValidationResult=exports.State=exports.Severity=exports.SarifJobStatus=exports.ResultType=exports.MetadataOperation=exports.MetadataChangeType=exports.LicenseType=exports.LicenseState=exports.ExpandOption=exports.DismissalType=exports.DependencyScope=exports.DependencyKind=exports.Confidence=exports.ComponentType=exports.AutofixRequestStatus=exports.AutofixRequestFailedReason=exports.AutofixCallbackStatus=exports.AnalysisConfigurationType=exports.AlertValidityStatus=exports.AlertValidationRequestStatus=exports.AlertType=exports.AlertMetadataErrorPolicy=exports.AlertListExpandOption=void 0;var AlertListExpandOption;!function(e){e[e.None=0]="None",e[e.Minimal=1]="Minimal",e[e.Count=2]="Count"}(AlertListExpandOption||(exports.AlertListExpandOption=AlertListExpandOption={}));var AlertMetadataErrorPolicy;!function(e){e[e.Fail=1]="Fail",e[e.Omit=2]="Omit"}(AlertMetadataErrorPolicy||(exports.AlertMetadataErrorPolicy=AlertMetadataErrorPolicy={}));var AlertType;!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",e[e.AICode=5]="AICode"}(AlertType||(exports.AlertType=AlertType={}));var AlertValidationRequestStatus;!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"}(AlertValidationRequestStatus||(exports.AlertValidationRequestStatus=AlertValidationRequestStatus={}));var AlertValidityStatus;!function(e){e[e.None=0]="None",e[e.Unknown=1]="Unknown",e[e.Active=2]="Active",e[e.Inactive=3]="Inactive"}(AlertValidityStatus||(exports.AlertValidityStatus=AlertValidityStatus={}));var AnalysisConfigurationType;!function(e){e[e.Default=0]="Default",e[e.AdoPipeline=1]="AdoPipeline"}(AnalysisConfigurationType||(exports.AnalysisConfigurationType=AnalysisConfigurationType={}));var AutofixCallbackStatus;!function(e){e[e.Done=0]="Done",e[e.Failed=1]="Failed",e[e.NoChangesProduced=2]="NoChangesProduced"}(AutofixCallbackStatus||(exports.AutofixCallbackStatus=AutofixCallbackStatus={}));var AutofixRequestFailedReason;!function(e){e[e.None=0]="None",e[e.PipelineFailed=1]="PipelineFailed",e[e.PipelineTimedOut=2]="PipelineTimedOut",e[e.CallbackNotReceived=3]="CallbackNotReceived",e[e.ProcessorJobFailed=4]="ProcessorJobFailed",e[e.NoChanges=5]="NoChanges"}(AutofixRequestFailedReason||(exports.AutofixRequestFailedReason=AutofixRequestFailedReason={}));var AutofixRequestStatus;!function(e){e[e.None=0]="None",e[e.Pending=1]="Pending",e[e.PipelineRunning=2]="PipelineRunning",e[e.Done=3]="Done",e[e.Failed=4]="Failed"}(AutofixRequestStatus||(exports.AutofixRequestStatus=AutofixRequestStatus={}));var ComponentType;!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"}(ComponentType||(exports.ComponentType=ComponentType={}));var Confidence;!function(e){e[e.High=0]="High",e[e.Other=1]="Other"}(Confidence||(exports.Confidence=Confidence={}));var DependencyKind;!function(e){e[e.Unknown=0]="Unknown",e[e.RootDependency=1]="RootDependency",e[e.Component=2]="Component",e[e.VulnerableDependency=3]="VulnerableDependency"}(DependencyKind||(exports.DependencyKind=DependencyKind={}));var DependencyScope;!function(e){e[e.Runtime=0]="Runtime",e[e.Development=1]="Development"}(DependencyScope||(exports.DependencyScope=DependencyScope={}));var DismissalType;!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"}(DismissalType||(exports.DismissalType=DismissalType={}));var ExpandOption;!function(e){e[e.None=0]="None",e[e.ValidationFingerprint=1]="ValidationFingerprint",e[e.AIMetadataBlobReference=2]="AIMetadataBlobReference"}(ExpandOption||(exports.ExpandOption=ExpandOption={}));var LicenseState;!function(e){e[e.Unknown=0]="Unknown",e[e.NotHarvested=1]="NotHarvested",e[e.Harvested=2]="Harvested"}(LicenseState||(exports.LicenseState=LicenseState={}));var LicenseType;!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"}(LicenseType||(exports.LicenseType=LicenseType={}));var MetadataChangeType;!function(e){e[e.None=0]="None",e[e.Created=1]="Created",e[e.Updated=2]="Updated",e[e.Deleted=3]="Deleted"}(MetadataChangeType||(exports.MetadataChangeType=MetadataChangeType={}));var MetadataOperation;!function(e){e[e.None=0]="None",e[e.Add=1]="Add",e[e.Remove=2]="Remove"}(MetadataOperation||(exports.MetadataOperation=MetadataOperation={}));var ResultType;!function(e){e[e.Unknown=0]="Unknown",e[e.Dependency=1]="Dependency",e[e.VersionControl=2]="VersionControl"}(ResultType||(exports.ResultType=ResultType={}));var SarifJobStatus;!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",e[e.ConcurrentProcessing=5]="ConcurrentProcessing",e[e.Consolidated=6]="Consolidated",e[e.WaitingConsolidation=7]="WaitingConsolidation"}(SarifJobStatus||(exports.SarifJobStatus=SarifJobStatus={}));var Severity;!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"}(Severity||(exports.Severity=Severity={}));var State;!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",e[e.Draft=16]="Draft"}(State||(exports.State=State={}));var ValidationResult;!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"}(ValidationResult||(exports.ValidationResult=ValidationResult={}));
@@ -4,6 +4,18 @@ import * as Alert from "../Alert/Alert";
4
4
  import * as WebApi from "../WebApi/WebApi";
5
5
  export declare class AlertRestClient extends RestClientBase {
6
6
  constructor(options: IVssRestClientOptions);
7
+ /**
8
+ * Download the full AI metadata blob for an AI code alert.
9
+ *
10
+ * @param project - Project ID or project name
11
+ * @param alertId - ID of the alert whose AI metadata blob should be downloaded.
12
+ * @param repository - Name or id of the repository that the alert is part of.
13
+ */
14
+ getAiMetadataContent(project: string, alertId: number, repository: string): Promise<any>;
15
+ /**
16
+ * @param submissionId -
17
+ */
18
+ getSarifContent(submissionId: number): Promise<any>;
7
19
  /**
8
20
  * Get an alert.
9
21
  *
@@ -51,8 +63,17 @@ export declare class AlertRestClient extends RestClientBase {
51
63
  * @param request - Request containing alert IDs and optional alert type filter
52
64
  * @param project - Project ID or project name
53
65
  * @param repository - The name or ID of the repository
66
+ * @param includeSensitiveInformation - Applies to secret alerts only. When false (the default), the 'ValidationFingerprintJson' of each secret alert's validation fingerprints is omitted from the response. Set to true to include it; be aware that the validation fingerprint JSON may contain the unencrypted secret and other sensitive data, so exercise caution when requesting it.
67
+ */
68
+ getAlertsByIds(request: Alert.AlertBatchRequest, project: string, repository: string, includeSensitiveInformation?: boolean): Promise<Alert.Alert[]>;
69
+ /**
70
+ * Batch update alert states. Internal use only — used by proof scanners to transition AI-generated draft alerts to Active or Dismissed. Alerts marked as Draft (indeterminate) are left unchanged.
71
+ *
72
+ * @param request - Request containing alert state updates
73
+ * @param project - Project ID or project name
74
+ * @param repository - The name or ID of the repository
54
75
  */
55
- getAlertsByIds(request: Alert.AlertBatchRequest, project: string, repository: string): Promise<Alert.Alert[]>;
76
+ updateAlertsBatch(request: Alert.AlertBatchStateUpdateRequest, project: string, repository: string): Promise<Alert.Alert[]>;
56
77
  /**
57
78
  * Returns the branches for which analysis results were submitted.
58
79
  *
@@ -86,16 +107,18 @@ export declare class AlertRestClient extends RestClientBase {
86
107
  * @param project - Project ID or project name
87
108
  * @param alertId - The ID of the alert to create an autofix for.
88
109
  * @param repository - The name or ID of the repository.
110
+ * @param ref - Optional Git ref (e.g. refs/heads/feature/x) the autofix should target. When omitted, the repository's default branch is used.
89
111
  */
90
- createAutofixRequest(project: string, alertId: number, repository: string): Promise<Alert.AutofixRequest>;
112
+ createAutofixRequest(project: string, alertId: number, repository: string, ref?: string): Promise<Alert.AutofixRequest>;
91
113
  /**
92
114
  * Get all autofix requests for the specified alert.
93
115
  *
94
116
  * @param project - Project ID or project name
95
117
  * @param alertId - The ID of the alert.
96
118
  * @param repository - The name or ID of the repository.
119
+ * @param ref - Optional Git ref (e.g. refs/heads/feature/x) the autofix should target. When omitted, the repository's default branch is used.
97
120
  */
98
- getAutofixRequestsByAlertId(project: string, alertId: number, repository: string): Promise<Alert.AutofixRequest[]>;
121
+ getAutofixRequestsByAlertId(project: string, alertId: number, repository: string, ref?: string): Promise<Alert.AutofixRequest[]>;
99
122
  /**
100
123
  * Upload a SARIF to GitHub Code Scanning via a GitOps app.
101
124
  *
@@ -21,6 +21,40 @@ class AlertRestClient extends RestClientBase_1.RestClientBase {
21
21
  constructor(options) {
22
22
  super(options);
23
23
  }
24
+ /**
25
+ * Download the full AI metadata blob for an AI code alert.
26
+ *
27
+ * @param project - Project ID or project name
28
+ * @param alertId - ID of the alert whose AI metadata blob should be downloaded.
29
+ * @param repository - Name or id of the repository that the alert is part of.
30
+ */
31
+ getAiMetadataContent(project, alertId, repository) {
32
+ return __awaiter(this, void 0, void 0, function* () {
33
+ return this.beginRequest({
34
+ apiVersion: "7.2-preview.1",
35
+ routeTemplate: "{project}/_apis/Alert/repositories/{repository}/alerts/{alertId}/aimetadata",
36
+ routeValues: {
37
+ project: project,
38
+ alertId: alertId,
39
+ repository: repository
40
+ }
41
+ });
42
+ });
43
+ }
44
+ /**
45
+ * @param submissionId -
46
+ */
47
+ getSarifContent(submissionId) {
48
+ return __awaiter(this, void 0, void 0, function* () {
49
+ return this.beginRequest({
50
+ apiVersion: "7.2-preview.1",
51
+ routeTemplate: "_apis/Alert/sarifs/download/{submissionId}",
52
+ routeValues: {
53
+ submissionId: submissionId
54
+ }
55
+ });
56
+ });
57
+ }
24
58
  /**
25
59
  * Get an alert.
26
60
  *
@@ -140,9 +174,13 @@ class AlertRestClient extends RestClientBase_1.RestClientBase {
140
174
  * @param request - Request containing alert IDs and optional alert type filter
141
175
  * @param project - Project ID or project name
142
176
  * @param repository - The name or ID of the repository
177
+ * @param includeSensitiveInformation - Applies to secret alerts only. When false (the default), the 'ValidationFingerprintJson' of each secret alert's validation fingerprints is omitted from the response. Set to true to include it; be aware that the validation fingerprint JSON may contain the unencrypted secret and other sensitive data, so exercise caution when requesting it.
143
178
  */
144
- getAlertsByIds(request, project, repository) {
179
+ getAlertsByIds(request, project, repository, includeSensitiveInformation) {
145
180
  return __awaiter(this, void 0, void 0, function* () {
181
+ const queryValues = {
182
+ includeSensitiveInformation: includeSensitiveInformation
183
+ };
146
184
  return this.beginRequest({
147
185
  apiVersion: "7.2-preview.1",
148
186
  method: "POST",
@@ -151,6 +189,28 @@ class AlertRestClient extends RestClientBase_1.RestClientBase {
151
189
  project: project,
152
190
  repository: repository
153
191
  },
192
+ queryParams: queryValues,
193
+ body: request
194
+ });
195
+ });
196
+ }
197
+ /**
198
+ * Batch update alert states. Internal use only — used by proof scanners to transition AI-generated draft alerts to Active or Dismissed. Alerts marked as Draft (indeterminate) are left unchanged.
199
+ *
200
+ * @param request - Request containing alert state updates
201
+ * @param project - Project ID or project name
202
+ * @param repository - The name or ID of the repository
203
+ */
204
+ updateAlertsBatch(request, project, repository) {
205
+ return __awaiter(this, void 0, void 0, function* () {
206
+ return this.beginRequest({
207
+ apiVersion: "7.2-preview.1",
208
+ method: "PATCH",
209
+ routeTemplate: "{project}/_apis/Alert/repositories/{repository}/AlertsBatch",
210
+ routeValues: {
211
+ project: project,
212
+ repository: repository
213
+ },
154
214
  body: request
155
215
  });
156
216
  });
@@ -239,9 +299,13 @@ class AlertRestClient extends RestClientBase_1.RestClientBase {
239
299
  * @param project - Project ID or project name
240
300
  * @param alertId - The ID of the alert to create an autofix for.
241
301
  * @param repository - The name or ID of the repository.
302
+ * @param ref - Optional Git ref (e.g. refs/heads/feature/x) the autofix should target. When omitted, the repository's default branch is used.
242
303
  */
243
- createAutofixRequest(project, alertId, repository) {
304
+ createAutofixRequest(project, alertId, repository, ref) {
244
305
  return __awaiter(this, void 0, void 0, function* () {
306
+ const queryValues = {
307
+ ref: ref
308
+ };
245
309
  return this.beginRequest({
246
310
  apiVersion: "7.2-preview.1",
247
311
  method: "POST",
@@ -251,7 +315,8 @@ class AlertRestClient extends RestClientBase_1.RestClientBase {
251
315
  alertId: alertId,
252
316
  repository: repository,
253
317
  action: "Default"
254
- }
318
+ },
319
+ queryParams: queryValues
255
320
  });
256
321
  });
257
322
  }
@@ -261,9 +326,13 @@ class AlertRestClient extends RestClientBase_1.RestClientBase {
261
326
  * @param project - Project ID or project name
262
327
  * @param alertId - The ID of the alert.
263
328
  * @param repository - The name or ID of the repository.
329
+ * @param ref - Optional Git ref (e.g. refs/heads/feature/x) the autofix should target. When omitted, the repository's default branch is used.
264
330
  */
265
- getAutofixRequestsByAlertId(project, alertId, repository) {
331
+ getAutofixRequestsByAlertId(project, alertId, repository, ref) {
266
332
  return __awaiter(this, void 0, void 0, function* () {
333
+ const queryValues = {
334
+ ref: ref
335
+ };
267
336
  return this.beginRequest({
268
337
  apiVersion: "7.2-preview.1",
269
338
  routeTemplate: "{project}/_apis/Alert/repositories/{repository}/alerts/{alertId}/Autofix/{action}",
@@ -272,7 +341,8 @@ class AlertRestClient extends RestClientBase_1.RestClientBase {
272
341
  alertId: alertId,
273
342
  repository: repository,
274
343
  action: "Default"
275
- }
344
+ },
345
+ queryParams: queryValues
276
346
  });
277
347
  });
278
348
  }