azure-devops-extension-api 5.275.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.
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
  */
@@ -464,17 +485,51 @@ export declare enum AutofixCallbackStatus {
464
485
  /**
465
486
  * The pipeline or post-processing failed.
466
487
  */
467
- 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
468
493
  }
469
494
  /**
470
495
  * Represents an autofix request resource.
471
496
  */
472
497
  export interface AutofixRequest {
473
498
  createdDate: Date;
499
+ failedReason: AutofixRequestFailedReason;
474
500
  pipelinePlanId: string;
475
501
  requestId: number;
476
502
  status: AutofixRequestStatus;
477
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
+ }
478
533
  /**
479
534
  * Indicates the lifecycle status of an autofix request. Maps to TINYINT in the database.
480
535
  */
@@ -647,6 +702,10 @@ export interface DependencyResult {
647
702
  */
648
703
  versionControlFilePath: VersionControlFilePath;
649
704
  }
705
+ export declare enum DependencyScope {
706
+ Runtime = 0,
707
+ Development = 1
708
+ }
650
709
  /**
651
710
  * Information about an alert dismissal
652
711
  */
@@ -711,7 +770,11 @@ export declare enum ExpandOption {
711
770
  /**
712
771
  * Return validationFingerprints in Alert.
713
772
  */
714
- ValidationFingerprint = 1
773
+ ValidationFingerprint = 1,
774
+ /**
775
+ * Return the AI metadata blob reference in Alert.
776
+ */
777
+ AIMetadataBlobReference = 2
715
778
  }
716
779
  /**
717
780
  * Details for a legal review for a given component
@@ -1062,7 +1125,15 @@ export declare enum SarifJobStatus {
1062
1125
  /**
1063
1126
  * The job is currently being processed in the concurrent processing workflow exclusive for no autofix flows
1064
1127
  */
1065
- 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
1066
1137
  }
1067
1138
  export interface SarifUploadStatus {
1068
1139
  errors: SarifValidationError[];
@@ -1090,6 +1161,10 @@ export interface SearchCriteria {
1090
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.
1091
1162
  */
1092
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;
1093
1168
  /**
1094
1169
  * If provided, only return alerts last seen after this date. \<br /\>Otherwise return all alerts.
1095
1170
  */
@@ -1162,6 +1237,10 @@ export interface SearchCriteria {
1162
1237
  * If provided with toolName, only return alerts detected by this tool. \<br /\>Otherwise, return alerts detected by all tools.
1163
1238
  */
1164
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[];
1165
1244
  /**
1166
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.
1167
1246
  */
@@ -1207,6 +1286,10 @@ export declare enum State {
1207
1286
  * An Analysis tool that can generate security alerts
1208
1287
  */
1209
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;
1210
1293
  /**
1211
1294
  * Name of the tool
1212
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
  /**
@@ -125,7 +125,41 @@ var AutofixCallbackStatus;
125
125
  * The pipeline or post-processing failed.
126
126
  */
127
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";
128
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 = {}));
129
163
  /**
130
164
  * Indicates the lifecycle status of an autofix request. Maps to TINYINT in the database.
131
165
  */
@@ -247,6 +281,11 @@ var DependencyKind;
247
281
  */
248
282
  DependencyKind[DependencyKind["VulnerableDependency"] = 3] = "VulnerableDependency";
249
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 = {}));
250
289
  var DismissalType;
251
290
  (function (DismissalType) {
252
291
  /**
@@ -288,6 +327,10 @@ var ExpandOption;
288
327
  * Return validationFingerprints in Alert.
289
328
  */
290
329
  ExpandOption[ExpandOption["ValidationFingerprint"] = 1] = "ValidationFingerprint";
330
+ /**
331
+ * Return the AI metadata blob reference in Alert.
332
+ */
333
+ ExpandOption[ExpandOption["AIMetadataBlobReference"] = 2] = "AIMetadataBlobReference";
291
334
  })(ExpandOption || (exports.ExpandOption = ExpandOption = {}));
292
335
  var LicenseState;
293
336
  (function (LicenseState) {
@@ -410,6 +453,14 @@ var SarifJobStatus;
410
453
  * The job is currently being processed in the concurrent processing workflow exclusive for no autofix flows
411
454
  */
412
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";
413
464
  })(SarifJobStatus || (exports.SarifJobStatus = SarifJobStatus = {}));
414
465
  var Severity;
415
466
  (function (Severity) {
@@ -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",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"}(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",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={}));
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,14 @@ 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>;
7
15
  /**
8
16
  * @param submissionId -
9
17
  */
@@ -21,6 +21,26 @@ 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
+ }
24
44
  /**
25
45
  * @param submissionId -
26
46
  */
@@ -1 +1 @@
1
- "use strict";var __awaiter=this&&this.__awaiter||function(e,t,r,i){return new(r||(r=Promise))(function(o,s){function a(e){try{p(i.next(e))}catch(e){s(e)}}function n(e){try{p(i.throw(e))}catch(e){s(e)}}function p(e){e.done?o(e.value):function(e){return e instanceof r?e:new r(function(t){t(e)})}(e.value).then(a,n)}p((i=i.apply(e,t||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0}),exports.AlertRestClient=void 0;const RestClientBase_1=require("../Common/RestClientBase"),Serialization_1=require("../Common/Util/Serialization");class AlertRestClient extends RestClientBase_1.RestClientBase{constructor(e){super(e)}getSarifContent(e){return __awaiter(this,void 0,void 0,function*(){return this.beginRequest({apiVersion:"7.2-preview.1",routeTemplate:"_apis/Alert/sarifs/download/{submissionId}",routeValues:{submissionId:e}})})}getAlert(e,t,r,i,o){return __awaiter(this,void 0,void 0,function*(){const s={ref:i,expand:o};return this.beginRequest({apiVersion:"7.2-preview.1",routeTemplate:"{project}/_apis/Alert/repositories/{repository}/alerts/{alertId}",routeValues:{project:e,alertId:t,repository:r},queryParams:s})})}getAlerts(e,t,r,i,o,s,a){return __awaiter(this,void 0,void 0,function*(){const n={top:r,orderBy:i,criteria:o,expand:s,continuationToken:a};return this.beginRequest({apiVersion:"7.2-preview.1",routeTemplate:"{project}/_apis/Alert/repositories/{repository}/alerts/{alertId}",routeValues:{project:e,repository:t},queryParams:n,returnRawResponse:!0}).then(e=>__awaiter(this,void 0,void 0,function*(){const t=yield e.text().then(Serialization_1.deserializeVssJsonObject);return t.continuationToken=e.headers.get("x-ms-continuationtoken"),t}))})}getAlertSarif(e,t,r,i,o){return __awaiter(this,void 0,void 0,function*(){const s={ref:i,expand:o};return this.beginRequest({apiVersion:"7.2-preview.1",routeTemplate:"{project}/_apis/Alert/repositories/{repository}/alerts/{alertId}",routeValues:{project:e,alertId:t,repository:r},queryParams:s})})}updateAlert(e,t,r,i){return __awaiter(this,void 0,void 0,function*(){return this.beginRequest({apiVersion:"7.2-preview.1",method:"PATCH",routeTemplate:"{project}/_apis/Alert/repositories/{repository}/alerts/{alertId}",routeValues:{project:t,alertId:r,repository:i},body:e})})}getAlertsByIds(e,t,r,i){return __awaiter(this,void 0,void 0,function*(){const o={includeSensitiveInformation:i};return this.beginRequest({apiVersion:"7.2-preview.1",method:"POST",routeTemplate:"{project}/_apis/Alert/repositories/{repository}/AlertsBatch",routeValues:{project:t,repository:r},queryParams:o,body:e})})}updateAlertsBatch(e,t,r){return __awaiter(this,void 0,void 0,function*(){return this.beginRequest({apiVersion:"7.2-preview.1",method:"PATCH",routeTemplate:"{project}/_apis/Alert/repositories/{repository}/AlertsBatch",routeValues:{project:t,repository:r},body:e})})}getBranches(e,t,r,i,o,s,a){return __awaiter(this,void 0,void 0,function*(){const n={alertType:r,continuationToken:i,branchNameContains:o,top:s,includePullRequestBranches:a};return this.beginRequest({apiVersion:"7.2-preview.1",routeTemplate:"{project}/_apis/Alert/repositories/{repository}/filters/{action}",routeValues:{project:e,repository:t,action:"Branches"},queryParams:n})})}getUxFilters(e,t,r){return __awaiter(this,void 0,void 0,function*(){const i={alertType:r};return this.beginRequest({apiVersion:"7.2-preview.1",routeTemplate:"{project}/_apis/Alert/repositories/{repository}/filters/{action}",routeValues:{project:e,repository:t,action:"Default"},queryParams:i})})}autofixCallback(e,t,r,i){return __awaiter(this,void 0,void 0,function*(){return this.beginRequest({apiVersion:"7.2-preview.1",method:"POST",routeTemplate:"{project}/_apis/Alert/repositories/{repository}/alerts/{alertId}/Autofix/{action}",routeValues:{project:t,repository:r,alertId:i,action:"Callback"},body:e})})}createAutofixRequest(e,t,r,i){return __awaiter(this,void 0,void 0,function*(){const o={ref:i};return this.beginRequest({apiVersion:"7.2-preview.1",method:"POST",routeTemplate:"{project}/_apis/Alert/repositories/{repository}/alerts/{alertId}/Autofix/{action}",routeValues:{project:e,alertId:t,repository:r,action:"Default"},queryParams:o})})}getAutofixRequestsByAlertId(e,t,r,i){return __awaiter(this,void 0,void 0,function*(){const o={ref:i};return this.beginRequest({apiVersion:"7.2-preview.1",routeTemplate:"{project}/_apis/Alert/repositories/{repository}/alerts/{alertId}/Autofix/{action}",routeValues:{project:e,alertId:t,repository:r,action:"Default"},queryParams:o})})}uploadSarifToGitHub(e,t,r,i,o){return __awaiter(this,void 0,void 0,function*(){return this.beginRequest({apiVersion:"7.2-preview.1",method:"POST",routeTemplate:"{project}/_apis/Alert/github/{hostname}/{owner}/{repo}/sarifs",routeValues:{project:t,hostname:r,owner:i,repo:o},customHeaders:{"Content-Type":"application/octet-stream"},body:e})})}getAlertInstances(e,t,r,i){return __awaiter(this,void 0,void 0,function*(){const o={ref:i};return this.beginRequest({apiVersion:"7.2-preview.1",routeTemplate:"{project}/_apis/Alert/repositories/{repository}/alerts/{alertId}/Instances",routeValues:{project:e,alertId:t,repository:r},queryParams:o})})}createLegalReview(e,t,r,i){return __awaiter(this,void 0,void 0,function*(){const o={alertId:r,ref:i};return this.beginRequest({apiVersion:"7.2-preview.1",method:"POST",routeTemplate:"{project}/_apis/Alert/repositories/{repository}/alerts/Metadata",routeValues:{project:e,repository:t},queryParams:o})})}updateAlertsMetadata(e,t,r){return __awaiter(this,void 0,void 0,function*(){return this.beginRequest({apiVersion:"7.2-preview.1",method:"PATCH",routeTemplate:"{project}/_apis/Alert/repositories/{repository}/alerts/Metadata",routeValues:{project:t,repository:r},body:e})})}getAlertMetadata(e,t,r){return __awaiter(this,void 0,void 0,function*(){return this.beginRequest({apiVersion:"7.2-preview.1",routeTemplate:"{project}/_apis/Alert/repositories/{repository}/alerts/{alertId}/metadata",routeValues:{project:e,alertId:t,repository:r}})})}getAlertMetadataBatch(e,t,r){return __awaiter(this,void 0,void 0,function*(){return this.beginRequest({apiVersion:"7.2-preview.1",method:"POST",routeTemplate:"{project}/_apis/Alert/repositories/{repository}/alerts/MetadataBatch",routeValues:{project:t,repository:r},body:e})})}getOrgLevelAlertsByIds(e){return __awaiter(this,void 0,void 0,function*(){const t={alertIds:e&&e.join(",")};return this.beginRequest({apiVersion:"7.2-preview.1",routeTemplate:"_apis/Alert/alerts",queryParams:t})})}deleteAllPipelineAnalyses(e,t){return __awaiter(this,void 0,void 0,function*(){return this.beginRequest({apiVersion:"7.2-preview.1",method:"DELETE",routeTemplate:"{project}/_apis/Alert/repositories/{repository}/pipelineAnalyses",routeValues:{project:e,repository:t}})})}deletePipelineAnalysis(e,t,r){return __awaiter(this,void 0,void 0,function*(){return this.beginRequest({apiVersion:"7.2-preview.1",method:"DELETE",routeTemplate:"{project}/_apis/Alert/repositories/{repository}/pipelineAnalysis/{adoPipelineId}",routeValues:{project:e,repository:t,adoPipelineId:r}})})}exportSarif(e,t,r,i){return __awaiter(this,void 0,void 0,function*(){const o={alertIds:r,branchName:i};return this.beginRequest({apiVersion:"7.2-preview.1",routeTemplate:"{project}/_apis/Alert/repositories/{repository}/sarifs",routeValues:{project:e,repository:t},queryParams:o})})}uploadSarif(e,t,r,i){return __awaiter(this,void 0,void 0,function*(){return 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":i},body:e})})}getSarif(e){return __awaiter(this,void 0,void 0,function*(){return this.beginRequest({apiVersion:"7.2-preview.2",routeTemplate:"_apis/Alert/Sarifs/{sarifId}",routeValues:{sarifId:e}})})}uploadOrgSarif(e){return __awaiter(this,void 0,void 0,function*(){return this.beginRequest({apiVersion:"7.2-preview.2",method:"POST",routeTemplate:"_apis/Alert/Sarifs/{sarifId}",customHeaders:{"Content-Type":"application/octet-stream"},body:e})})}getValidityData(e,t,r){return __awaiter(this,void 0,void 0,function*(){return this.beginRequest({apiVersion:"7.2-preview.1",routeTemplate:"{project}/_apis/Alert/repositories/{repository}/alerts/{alertId}/Validate",routeValues:{project:e,repository:t,alertId:r}})})}initiateValidation(e,t,r){return __awaiter(this,void 0,void 0,function*(){return 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}})})}}exports.AlertRestClient=AlertRestClient;
1
+ "use strict";var __awaiter=this&&this.__awaiter||function(e,t,r,i){return new(r||(r=Promise))(function(o,s){function a(e){try{p(i.next(e))}catch(e){s(e)}}function n(e){try{p(i.throw(e))}catch(e){s(e)}}function p(e){e.done?o(e.value):function(e){return e instanceof r?e:new r(function(t){t(e)})}(e.value).then(a,n)}p((i=i.apply(e,t||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0}),exports.AlertRestClient=void 0;const RestClientBase_1=require("../Common/RestClientBase"),Serialization_1=require("../Common/Util/Serialization");class AlertRestClient extends RestClientBase_1.RestClientBase{constructor(e){super(e)}getAiMetadataContent(e,t,r){return __awaiter(this,void 0,void 0,function*(){return this.beginRequest({apiVersion:"7.2-preview.1",routeTemplate:"{project}/_apis/Alert/repositories/{repository}/alerts/{alertId}/aimetadata",routeValues:{project:e,alertId:t,repository:r}})})}getSarifContent(e){return __awaiter(this,void 0,void 0,function*(){return this.beginRequest({apiVersion:"7.2-preview.1",routeTemplate:"_apis/Alert/sarifs/download/{submissionId}",routeValues:{submissionId:e}})})}getAlert(e,t,r,i,o){return __awaiter(this,void 0,void 0,function*(){const s={ref:i,expand:o};return this.beginRequest({apiVersion:"7.2-preview.1",routeTemplate:"{project}/_apis/Alert/repositories/{repository}/alerts/{alertId}",routeValues:{project:e,alertId:t,repository:r},queryParams:s})})}getAlerts(e,t,r,i,o,s,a){return __awaiter(this,void 0,void 0,function*(){const n={top:r,orderBy:i,criteria:o,expand:s,continuationToken:a};return this.beginRequest({apiVersion:"7.2-preview.1",routeTemplate:"{project}/_apis/Alert/repositories/{repository}/alerts/{alertId}",routeValues:{project:e,repository:t},queryParams:n,returnRawResponse:!0}).then(e=>__awaiter(this,void 0,void 0,function*(){const t=yield e.text().then(Serialization_1.deserializeVssJsonObject);return t.continuationToken=e.headers.get("x-ms-continuationtoken"),t}))})}getAlertSarif(e,t,r,i,o){return __awaiter(this,void 0,void 0,function*(){const s={ref:i,expand:o};return this.beginRequest({apiVersion:"7.2-preview.1",routeTemplate:"{project}/_apis/Alert/repositories/{repository}/alerts/{alertId}",routeValues:{project:e,alertId:t,repository:r},queryParams:s})})}updateAlert(e,t,r,i){return __awaiter(this,void 0,void 0,function*(){return this.beginRequest({apiVersion:"7.2-preview.1",method:"PATCH",routeTemplate:"{project}/_apis/Alert/repositories/{repository}/alerts/{alertId}",routeValues:{project:t,alertId:r,repository:i},body:e})})}getAlertsByIds(e,t,r,i){return __awaiter(this,void 0,void 0,function*(){const o={includeSensitiveInformation:i};return this.beginRequest({apiVersion:"7.2-preview.1",method:"POST",routeTemplate:"{project}/_apis/Alert/repositories/{repository}/AlertsBatch",routeValues:{project:t,repository:r},queryParams:o,body:e})})}updateAlertsBatch(e,t,r){return __awaiter(this,void 0,void 0,function*(){return this.beginRequest({apiVersion:"7.2-preview.1",method:"PATCH",routeTemplate:"{project}/_apis/Alert/repositories/{repository}/AlertsBatch",routeValues:{project:t,repository:r},body:e})})}getBranches(e,t,r,i,o,s,a){return __awaiter(this,void 0,void 0,function*(){const n={alertType:r,continuationToken:i,branchNameContains:o,top:s,includePullRequestBranches:a};return this.beginRequest({apiVersion:"7.2-preview.1",routeTemplate:"{project}/_apis/Alert/repositories/{repository}/filters/{action}",routeValues:{project:e,repository:t,action:"Branches"},queryParams:n})})}getUxFilters(e,t,r){return __awaiter(this,void 0,void 0,function*(){const i={alertType:r};return this.beginRequest({apiVersion:"7.2-preview.1",routeTemplate:"{project}/_apis/Alert/repositories/{repository}/filters/{action}",routeValues:{project:e,repository:t,action:"Default"},queryParams:i})})}autofixCallback(e,t,r,i){return __awaiter(this,void 0,void 0,function*(){return this.beginRequest({apiVersion:"7.2-preview.1",method:"POST",routeTemplate:"{project}/_apis/Alert/repositories/{repository}/alerts/{alertId}/Autofix/{action}",routeValues:{project:t,repository:r,alertId:i,action:"Callback"},body:e})})}createAutofixRequest(e,t,r,i){return __awaiter(this,void 0,void 0,function*(){const o={ref:i};return this.beginRequest({apiVersion:"7.2-preview.1",method:"POST",routeTemplate:"{project}/_apis/Alert/repositories/{repository}/alerts/{alertId}/Autofix/{action}",routeValues:{project:e,alertId:t,repository:r,action:"Default"},queryParams:o})})}getAutofixRequestsByAlertId(e,t,r,i){return __awaiter(this,void 0,void 0,function*(){const o={ref:i};return this.beginRequest({apiVersion:"7.2-preview.1",routeTemplate:"{project}/_apis/Alert/repositories/{repository}/alerts/{alertId}/Autofix/{action}",routeValues:{project:e,alertId:t,repository:r,action:"Default"},queryParams:o})})}uploadSarifToGitHub(e,t,r,i,o){return __awaiter(this,void 0,void 0,function*(){return this.beginRequest({apiVersion:"7.2-preview.1",method:"POST",routeTemplate:"{project}/_apis/Alert/github/{hostname}/{owner}/{repo}/sarifs",routeValues:{project:t,hostname:r,owner:i,repo:o},customHeaders:{"Content-Type":"application/octet-stream"},body:e})})}getAlertInstances(e,t,r,i){return __awaiter(this,void 0,void 0,function*(){const o={ref:i};return this.beginRequest({apiVersion:"7.2-preview.1",routeTemplate:"{project}/_apis/Alert/repositories/{repository}/alerts/{alertId}/Instances",routeValues:{project:e,alertId:t,repository:r},queryParams:o})})}createLegalReview(e,t,r,i){return __awaiter(this,void 0,void 0,function*(){const o={alertId:r,ref:i};return this.beginRequest({apiVersion:"7.2-preview.1",method:"POST",routeTemplate:"{project}/_apis/Alert/repositories/{repository}/alerts/Metadata",routeValues:{project:e,repository:t},queryParams:o})})}updateAlertsMetadata(e,t,r){return __awaiter(this,void 0,void 0,function*(){return this.beginRequest({apiVersion:"7.2-preview.1",method:"PATCH",routeTemplate:"{project}/_apis/Alert/repositories/{repository}/alerts/Metadata",routeValues:{project:t,repository:r},body:e})})}getAlertMetadata(e,t,r){return __awaiter(this,void 0,void 0,function*(){return this.beginRequest({apiVersion:"7.2-preview.1",routeTemplate:"{project}/_apis/Alert/repositories/{repository}/alerts/{alertId}/metadata",routeValues:{project:e,alertId:t,repository:r}})})}getAlertMetadataBatch(e,t,r){return __awaiter(this,void 0,void 0,function*(){return this.beginRequest({apiVersion:"7.2-preview.1",method:"POST",routeTemplate:"{project}/_apis/Alert/repositories/{repository}/alerts/MetadataBatch",routeValues:{project:t,repository:r},body:e})})}getOrgLevelAlertsByIds(e){return __awaiter(this,void 0,void 0,function*(){const t={alertIds:e&&e.join(",")};return this.beginRequest({apiVersion:"7.2-preview.1",routeTemplate:"_apis/Alert/alerts",queryParams:t})})}deleteAllPipelineAnalyses(e,t){return __awaiter(this,void 0,void 0,function*(){return this.beginRequest({apiVersion:"7.2-preview.1",method:"DELETE",routeTemplate:"{project}/_apis/Alert/repositories/{repository}/pipelineAnalyses",routeValues:{project:e,repository:t}})})}deletePipelineAnalysis(e,t,r){return __awaiter(this,void 0,void 0,function*(){return this.beginRequest({apiVersion:"7.2-preview.1",method:"DELETE",routeTemplate:"{project}/_apis/Alert/repositories/{repository}/pipelineAnalysis/{adoPipelineId}",routeValues:{project:e,repository:t,adoPipelineId:r}})})}exportSarif(e,t,r,i){return __awaiter(this,void 0,void 0,function*(){const o={alertIds:r,branchName:i};return this.beginRequest({apiVersion:"7.2-preview.1",routeTemplate:"{project}/_apis/Alert/repositories/{repository}/sarifs",routeValues:{project:e,repository:t},queryParams:o})})}uploadSarif(e,t,r,i){return __awaiter(this,void 0,void 0,function*(){return 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":i},body:e})})}getSarif(e){return __awaiter(this,void 0,void 0,function*(){return this.beginRequest({apiVersion:"7.2-preview.2",routeTemplate:"_apis/Alert/Sarifs/{sarifId}",routeValues:{sarifId:e}})})}uploadOrgSarif(e){return __awaiter(this,void 0,void 0,function*(){return this.beginRequest({apiVersion:"7.2-preview.2",method:"POST",routeTemplate:"_apis/Alert/Sarifs/{sarifId}",customHeaders:{"Content-Type":"application/octet-stream"},body:e})})}getValidityData(e,t,r){return __awaiter(this,void 0,void 0,function*(){return this.beginRequest({apiVersion:"7.2-preview.1",routeTemplate:"{project}/_apis/Alert/repositories/{repository}/alerts/{alertId}/Validate",routeValues:{project:e,repository:t,alertId:r}})})}initiateValidation(e,t,r){return __awaiter(this,void 0,void 0,function*(){return 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}})})}}exports.AlertRestClient=AlertRestClient;
@@ -7,11 +7,18 @@ export declare class GitRestClient extends RestClientBase {
7
7
  constructor(options: IVssRestClientOptions);
8
8
  static readonly RESOURCE_AREA_ID = "4e080c62-fa21-4fbc-8fef-2a10a2b38049";
9
9
  /**
10
- * POST Creates (if needed) the AdvSec Autofix framework identity and grants it permissions. If projectId is provided, grants scoped to that project only. Otherwise initializes the identity for every project in the organization.
10
+ * POST Creates (if needed) the AdvSec Consolidation framework identity and grants it permissions. If projectId is provided, grants scoped to that project only. Otherwise initializes the identity for every project in the organization.
11
11
  *
12
12
  * @param projectId - Optional project GUID. When omitted, all projects in the organization are initialized.
13
13
  */
14
- initializeAutofixIdentity(projectId?: string): Promise<void>;
14
+ initializeConsolidationIdentity(projectId?: string): Promise<void>;
15
+ /**
16
+ * POST Creates (if needed) the AdvSec Autofix framework identity and grants it permissions. If repositoryId is provided, the Git repository permissions are granted scoped to that repository (so they apply even when the repository has permissions inheritance disabled), and projectId is required. If only projectId is provided, grants scoped to that project. Otherwise initializes the identity for every project in the organization.
17
+ *
18
+ * @param projectId - Optional project GUID. Required when repositoryId is provided. When both are omitted, all projects in the organization are initialized.
19
+ * @param repositoryId - Optional repository GUID. When provided, Git permissions are granted at the repository scope.
20
+ */
21
+ initializeAutofixIdentity(projectId?: string, repositoryId?: string): Promise<void>;
15
22
  /**
16
23
  * DELETE Deletes Enablement status and BillableCommitters data from DB. Deleting the enablement data will effectively disable it for the repositories affected.
17
24
  *
@@ -592,7 +599,7 @@ export declare class GitRestClient extends RestClientBase {
592
599
  /**
593
600
  * Request a git merge operation. Currently we support merging only 2 commits.
594
601
  *
595
- * @param mergeParameters - Parents commitIds and merge commit messsage.
602
+ * @param mergeParameters - Parents commitIds and merge commit message.
596
603
  * @param project - Project ID or project name
597
604
  * @param repositoryNameOrId - The name or ID of the repository.
598
605
  * @param includeLinks - True to include links
package/Git/GitClient.js CHANGED
@@ -22,15 +22,35 @@ class GitRestClient extends RestClientBase_1.RestClientBase {
22
22
  super(options);
23
23
  }
24
24
  /**
25
- * POST Creates (if needed) the AdvSec Autofix framework identity and grants it permissions. If projectId is provided, grants scoped to that project only. Otherwise initializes the identity for every project in the organization.
25
+ * POST Creates (if needed) the AdvSec Consolidation framework identity and grants it permissions. If projectId is provided, grants scoped to that project only. Otherwise initializes the identity for every project in the organization.
26
26
  *
27
27
  * @param projectId - Optional project GUID. When omitted, all projects in the organization are initialized.
28
28
  */
29
- initializeAutofixIdentity(projectId) {
29
+ initializeConsolidationIdentity(projectId) {
30
30
  return __awaiter(this, void 0, void 0, function* () {
31
31
  const queryValues = {
32
32
  '$projectId': projectId
33
33
  };
34
+ return this.beginRequest({
35
+ apiVersion: "7.2-preview.1",
36
+ method: "POST",
37
+ routeTemplate: "_apis/git/advsecConsolidation/author",
38
+ queryParams: queryValues
39
+ });
40
+ });
41
+ }
42
+ /**
43
+ * POST Creates (if needed) the AdvSec Autofix framework identity and grants it permissions. If repositoryId is provided, the Git repository permissions are granted scoped to that repository (so they apply even when the repository has permissions inheritance disabled), and projectId is required. If only projectId is provided, grants scoped to that project. Otherwise initializes the identity for every project in the organization.
44
+ *
45
+ * @param projectId - Optional project GUID. Required when repositoryId is provided. When both are omitted, all projects in the organization are initialized.
46
+ * @param repositoryId - Optional repository GUID. When provided, Git permissions are granted at the repository scope.
47
+ */
48
+ initializeAutofixIdentity(projectId, repositoryId) {
49
+ return __awaiter(this, void 0, void 0, function* () {
50
+ const queryValues = {
51
+ '$projectId': projectId,
52
+ '$repositoryId': repositoryId
53
+ };
34
54
  return this.beginRequest({
35
55
  apiVersion: "7.2-preview.1",
36
56
  method: "POST",
@@ -1579,7 +1599,7 @@ class GitRestClient extends RestClientBase_1.RestClientBase {
1579
1599
  /**
1580
1600
  * Request a git merge operation. Currently we support merging only 2 commits.
1581
1601
  *
1582
- * @param mergeParameters - Parents commitIds and merge commit messsage.
1602
+ * @param mergeParameters - Parents commitIds and merge commit message.
1583
1603
  * @param project - Project ID or project name
1584
1604
  * @param repositoryNameOrId - The name or ID of the repository.
1585
1605
  * @param includeLinks - True to include links