azure-devops-extension-api 5.275.0 → 5.279.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AdvancedSecurity.Reporting/Reporting.d.ts +81 -2
- package/AdvancedSecurity.Reporting/Reporting.js +4 -0
- package/AdvancedSecurity.Reporting/Reporting.min.js +1 -1
- package/Alert/Alert.d.ts +244 -9
- package/Alert/Alert.js +124 -1
- package/Alert/Alert.min.js +1 -1
- package/Alert/AlertClient.d.ts +76 -12
- package/Alert/AlertClient.js +205 -23
- package/Alert/AlertClient.min.js +1 -1
- package/Build/Build.d.ts +29 -0
- package/Build/Build.js +19 -1
- package/Build/Build.min.js +1 -1
- package/Gallery/Gallery.d.ts +46 -0
- package/Gallery/Gallery.js +11 -1
- package/Gallery/Gallery.min.js +1 -1
- package/Gallery/GalleryClient.d.ts +14 -0
- package/Gallery/GalleryClient.js +48 -0
- package/Gallery/GalleryClient.min.js +1 -1
- package/Git/Git.d.ts +2 -22
- package/Git/GitClient.d.ts +10 -3
- package/Git/GitClient.js +23 -3
- package/Git/GitClient.min.js +1 -1
- package/Management/Management.d.ts +38 -2
- package/Management/Management.js +4 -0
- package/Management/Management.min.js +1 -1
- package/ServiceHooks/ServiceHooks.d.ts +1 -1
- package/TaskAgent/TaskAgent.d.ts +2 -0
- package/Test/Test.d.ts +106 -56
- package/TestResults/TestResultsClient.d.ts +86 -20
- package/TestResults/TestResultsClient.js +226 -55
- package/TestResults/TestResultsClient.min.js +1 -1
- package/Tfvc/Tfvc.d.ts +54 -0
- package/Tfvc/Tfvc.js +57 -1
- package/Tfvc/Tfvc.min.js +1 -1
- package/Wiki/Wiki.d.ts +17 -0
- package/Wiki/WikiClient.d.ts +8 -0
- package/Wiki/WikiClient.js +23 -0
- package/Wiki/WikiClient.min.js +1 -1
- package/WorkItemTracking/WorkItemTracking.d.ts +48 -0
- package/WorkItemTracking/WorkItemTracking.js +11 -1
- package/WorkItemTracking/WorkItemTracking.min.js +1 -1
- package/esm/AdvancedSecurity.Reporting/Reporting.js +4 -0
- package/esm/AdvancedSecurity.Reporting/Reporting.min.js +1 -1
- package/esm/Alert/Alert.js +123 -0
- package/esm/Alert/Alert.min.js +1 -1
- package/esm/Alert/AlertClient.js +190 -22
- package/esm/Alert/AlertClient.min.js +1 -1
- package/esm/Build/Build.js +18 -0
- package/esm/Build/Build.min.js +1 -1
- package/esm/Gallery/Gallery.js +10 -0
- package/esm/Gallery/Gallery.min.js +1 -1
- package/esm/Gallery/GalleryClient.js +42 -0
- package/esm/Gallery/GalleryClient.min.js +1 -1
- package/esm/Git/GitClient.js +21 -3
- package/esm/Git/GitClient.min.js +1 -1
- package/esm/Management/Management.js +4 -0
- package/esm/Management/Management.min.js +1 -1
- package/esm/TestResults/TestResultsClient.js +208 -49
- package/esm/TestResults/TestResultsClient.min.js +1 -1
- package/esm/Tfvc/Tfvc.js +56 -0
- package/esm/Tfvc/Tfvc.min.js +1 -1
- package/esm/Wiki/WikiClient.js +21 -0
- package/esm/Wiki/WikiClient.min.js +1 -1
- package/esm/WorkItemTracking/WorkItemTracking.js +10 -0
- package/esm/WorkItemTracking/WorkItemTracking.min.js +1 -1
- package/package.json +1 -1
- package/_manifest/comparison-result.json +0 -40
- package/_manifest/spdx_2.2/ESRPClientLogs0716164721553.json +0 -1
- package/_manifest/spdx_2.2/bsi.cose +0 -0
- package/_manifest/spdx_2.2/bsi.json +0 -1
- package/_manifest/spdx_2.2/manifest.cat +0 -0
- package/_manifest/spdx_2.2/manifest.spdx.cose +0 -0
- package/_manifest/spdx_2.2/manifest.spdx.json +0 -1
- package/_manifest/spdx_2.2/manifest.spdx.json.sha256 +0 -1
- package/_manifest/spdx_3.0/manifest.spdx.json +0 -1
- package/_manifest/spdx_3.0/manifest.spdx.json.sha256 +0 -1
package/Alert/Alert.js
CHANGED
|
@@ -5,7 +5,39 @@
|
|
|
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 = exports.AlertJobType = exports.AlertJobArtifactType = void 0;
|
|
9
|
+
/**
|
|
10
|
+
* Identifies the supported artifact types produced by an alert job.
|
|
11
|
+
*/
|
|
12
|
+
var AlertJobArtifactType;
|
|
13
|
+
(function (AlertJobArtifactType) {
|
|
14
|
+
/**
|
|
15
|
+
* An artifact type not recognized by this client version.
|
|
16
|
+
*/
|
|
17
|
+
AlertJobArtifactType[AlertJobArtifactType["Unknown"] = 0] = "Unknown";
|
|
18
|
+
/**
|
|
19
|
+
* An Azure Repos pull request.
|
|
20
|
+
*/
|
|
21
|
+
AlertJobArtifactType[AlertJobArtifactType["PullRequest"] = 1] = "PullRequest";
|
|
22
|
+
})(AlertJobArtifactType || (exports.AlertJobArtifactType = AlertJobArtifactType = {}));
|
|
23
|
+
/**
|
|
24
|
+
* Identifies the supported alert job workflows.
|
|
25
|
+
*/
|
|
26
|
+
var AlertJobType;
|
|
27
|
+
(function (AlertJobType) {
|
|
28
|
+
/**
|
|
29
|
+
* An alert job type not recognized by this client version.
|
|
30
|
+
*/
|
|
31
|
+
AlertJobType[AlertJobType["Unknown"] = 0] = "Unknown";
|
|
32
|
+
/**
|
|
33
|
+
* A WIM workflow that creates a pull request.
|
|
34
|
+
*/
|
|
35
|
+
AlertJobType[AlertJobType["WIMAutoPR"] = 1] = "WIMAutoPR";
|
|
36
|
+
/**
|
|
37
|
+
* An AI alert consolidation workflow.
|
|
38
|
+
*/
|
|
39
|
+
AlertJobType[AlertJobType["AIAlertConsolidation"] = 2] = "AIAlertConsolidation";
|
|
40
|
+
})(AlertJobType || (exports.AlertJobType = AlertJobType = {}));
|
|
9
41
|
var AlertListExpandOption;
|
|
10
42
|
(function (AlertListExpandOption) {
|
|
11
43
|
/**
|
|
@@ -20,6 +52,10 @@ var AlertListExpandOption;
|
|
|
20
52
|
* Return only the count of active alerts grouped by alert type.
|
|
21
53
|
*/
|
|
22
54
|
AlertListExpandOption[AlertListExpandOption["Count"] = 2] = "Count";
|
|
55
|
+
/**
|
|
56
|
+
* Return the AI metadata blob reference in AI code alerts.
|
|
57
|
+
*/
|
|
58
|
+
AlertListExpandOption[AlertListExpandOption["AIMetadataBlobReference"] = 3] = "AIMetadataBlobReference";
|
|
23
59
|
})(AlertListExpandOption || (exports.AlertListExpandOption = AlertListExpandOption = {}));
|
|
24
60
|
/**
|
|
25
61
|
* Enum to control error policy in a bulk get alert metadata items request.
|
|
@@ -61,6 +97,10 @@ var AlertType;
|
|
|
61
97
|
* The code contains a weakness determined by AI-powered analysis.
|
|
62
98
|
*/
|
|
63
99
|
AlertType[AlertType["AICode"] = 5] = "AICode";
|
|
100
|
+
/**
|
|
101
|
+
* The code uses a dependency flagged as malware by the GitHub Advisory Database.
|
|
102
|
+
*/
|
|
103
|
+
AlertType[AlertType["Malware"] = 6] = "Malware";
|
|
64
104
|
})(AlertType || (exports.AlertType = AlertType = {}));
|
|
65
105
|
var AlertValidationRequestStatus;
|
|
66
106
|
(function (AlertValidationRequestStatus) {
|
|
@@ -125,7 +165,73 @@ var AutofixCallbackStatus;
|
|
|
125
165
|
* The pipeline or post-processing failed.
|
|
126
166
|
*/
|
|
127
167
|
AutofixCallbackStatus[AutofixCallbackStatus["Failed"] = 1] = "Failed";
|
|
168
|
+
/**
|
|
169
|
+
* The pipeline completed successfully but the autofix binary produced no changes, so no pull request was created.
|
|
170
|
+
*/
|
|
171
|
+
AutofixCallbackStatus[AutofixCallbackStatus["NoChangesProduced"] = 2] = "NoChangesProduced";
|
|
172
|
+
/**
|
|
173
|
+
* The pipeline completed successfully and determined that the alert is a false positive, so no pull request was created.
|
|
174
|
+
*/
|
|
175
|
+
AutofixCallbackStatus[AutofixCallbackStatus["FalsePositive"] = 3] = "FalsePositive";
|
|
176
|
+
/**
|
|
177
|
+
* The target file referenced by the analysis could not be found.
|
|
178
|
+
*/
|
|
179
|
+
AutofixCallbackStatus[AutofixCallbackStatus["TargetFileNotFound"] = 4] = "TargetFileNotFound";
|
|
180
|
+
/**
|
|
181
|
+
* The push was rejected by the commit author email validation policy.
|
|
182
|
+
*/
|
|
183
|
+
AutofixCallbackStatus[AutofixCallbackStatus["CommitAuthorEmailValidationFailed"] = 5] = "CommitAuthorEmailValidationFailed";
|
|
128
184
|
})(AutofixCallbackStatus || (exports.AutofixCallbackStatus = AutofixCallbackStatus = {}));
|
|
185
|
+
/**
|
|
186
|
+
* Indicates the reason an autofix request failed. Maps to TINYINT (nullable) in the database.
|
|
187
|
+
*/
|
|
188
|
+
var AutofixRequestFailedReason;
|
|
189
|
+
(function (AutofixRequestFailedReason) {
|
|
190
|
+
/**
|
|
191
|
+
* Default sentinel value; not a valid failure reason.
|
|
192
|
+
*/
|
|
193
|
+
AutofixRequestFailedReason[AutofixRequestFailedReason["None"] = 0] = "None";
|
|
194
|
+
/**
|
|
195
|
+
* The autofix pipeline run completed with a failure status.
|
|
196
|
+
*/
|
|
197
|
+
AutofixRequestFailedReason[AutofixRequestFailedReason["PipelineFailed"] = 1] = "PipelineFailed";
|
|
198
|
+
/**
|
|
199
|
+
* The autofix pipeline did not complete within the allowed time window.
|
|
200
|
+
*/
|
|
201
|
+
AutofixRequestFailedReason[AutofixRequestFailedReason["PipelineTimedOut"] = 2] = "PipelineTimedOut";
|
|
202
|
+
/**
|
|
203
|
+
* The expected callback from the pipeline was never received.
|
|
204
|
+
*/
|
|
205
|
+
AutofixRequestFailedReason[AutofixRequestFailedReason["CallbackNotReceived"] = 3] = "CallbackNotReceived";
|
|
206
|
+
/**
|
|
207
|
+
* The processor job encountered an error.
|
|
208
|
+
*/
|
|
209
|
+
AutofixRequestFailedReason[AutofixRequestFailedReason["ProcessorJobFailed"] = 4] = "ProcessorJobFailed";
|
|
210
|
+
/**
|
|
211
|
+
* 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.
|
|
212
|
+
*/
|
|
213
|
+
AutofixRequestFailedReason[AutofixRequestFailedReason["NoChanges"] = 5] = "NoChanges";
|
|
214
|
+
/**
|
|
215
|
+
* The target project's agent pool could not be found or has not been authorized for use, so the validation pipeline could not be queued. This is a user/configuration error.
|
|
216
|
+
*/
|
|
217
|
+
AutofixRequestFailedReason[AutofixRequestFailedReason["AgentPoolUnavailable"] = 6] = "AgentPoolUnavailable";
|
|
218
|
+
/**
|
|
219
|
+
* The alert ref cannot be resolved to an existing branch because the pull request or merge ref, source branch, or normal branch no longer exists.
|
|
220
|
+
*/
|
|
221
|
+
AutofixRequestFailedReason[AutofixRequestFailedReason["BranchNotResolvable"] = 7] = "BranchNotResolvable";
|
|
222
|
+
/**
|
|
223
|
+
* The pipeline completed successfully and determined that the alert is a false positive, so no pull request was created. This is a terminal non-PR result, not an operational pipeline failure.
|
|
224
|
+
*/
|
|
225
|
+
AutofixRequestFailedReason[AutofixRequestFailedReason["FalsePositive"] = 8] = "FalsePositive";
|
|
226
|
+
/**
|
|
227
|
+
* The target file referenced by the analysis could not be found.
|
|
228
|
+
*/
|
|
229
|
+
AutofixRequestFailedReason[AutofixRequestFailedReason["TargetFileNotFound"] = 9] = "TargetFileNotFound";
|
|
230
|
+
/**
|
|
231
|
+
* The push was rejected by the commit author email validation policy.
|
|
232
|
+
*/
|
|
233
|
+
AutofixRequestFailedReason[AutofixRequestFailedReason["CommitAuthorEmailValidationFailed"] = 10] = "CommitAuthorEmailValidationFailed";
|
|
234
|
+
})(AutofixRequestFailedReason || (exports.AutofixRequestFailedReason = AutofixRequestFailedReason = {}));
|
|
129
235
|
/**
|
|
130
236
|
* Indicates the lifecycle status of an autofix request. Maps to TINYINT in the database.
|
|
131
237
|
*/
|
|
@@ -247,6 +353,11 @@ var DependencyKind;
|
|
|
247
353
|
*/
|
|
248
354
|
DependencyKind[DependencyKind["VulnerableDependency"] = 3] = "VulnerableDependency";
|
|
249
355
|
})(DependencyKind || (exports.DependencyKind = DependencyKind = {}));
|
|
356
|
+
var DependencyScope;
|
|
357
|
+
(function (DependencyScope) {
|
|
358
|
+
DependencyScope[DependencyScope["Runtime"] = 0] = "Runtime";
|
|
359
|
+
DependencyScope[DependencyScope["Development"] = 1] = "Development";
|
|
360
|
+
})(DependencyScope || (exports.DependencyScope = DependencyScope = {}));
|
|
250
361
|
var DismissalType;
|
|
251
362
|
(function (DismissalType) {
|
|
252
363
|
/**
|
|
@@ -288,6 +399,10 @@ var ExpandOption;
|
|
|
288
399
|
* Return validationFingerprints in Alert.
|
|
289
400
|
*/
|
|
290
401
|
ExpandOption[ExpandOption["ValidationFingerprint"] = 1] = "ValidationFingerprint";
|
|
402
|
+
/**
|
|
403
|
+
* Return the AI metadata blob reference in Alert.
|
|
404
|
+
*/
|
|
405
|
+
ExpandOption[ExpandOption["AIMetadataBlobReference"] = 2] = "AIMetadataBlobReference";
|
|
291
406
|
})(ExpandOption || (exports.ExpandOption = ExpandOption = {}));
|
|
292
407
|
var LicenseState;
|
|
293
408
|
(function (LicenseState) {
|
|
@@ -410,6 +525,14 @@ var SarifJobStatus;
|
|
|
410
525
|
* The job is currently being processed in the concurrent processing workflow exclusive for no autofix flows
|
|
411
526
|
*/
|
|
412
527
|
SarifJobStatus[SarifJobStatus["ConcurrentProcessing"] = 5] = "ConcurrentProcessing";
|
|
528
|
+
/**
|
|
529
|
+
* 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.
|
|
530
|
+
*/
|
|
531
|
+
SarifJobStatus[SarifJobStatus["Consolidated"] = 6] = "Consolidated";
|
|
532
|
+
/**
|
|
533
|
+
* 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.
|
|
534
|
+
*/
|
|
535
|
+
SarifJobStatus[SarifJobStatus["WaitingConsolidation"] = 7] = "WaitingConsolidation";
|
|
413
536
|
})(SarifJobStatus || (exports.SarifJobStatus = SarifJobStatus = {}));
|
|
414
537
|
var Severity;
|
|
415
538
|
(function (Severity) {
|
package/Alert/Alert.min.js
CHANGED
|
@@ -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=exports.AlertJobType=exports.AlertJobArtifactType=void 0;var AlertJobArtifactType;!function(e){e[e.Unknown=0]="Unknown",e[e.PullRequest=1]="PullRequest"}(AlertJobArtifactType||(exports.AlertJobArtifactType=AlertJobArtifactType={}));var AlertJobType;!function(e){e[e.Unknown=0]="Unknown",e[e.WIMAutoPR=1]="WIMAutoPR",e[e.AIAlertConsolidation=2]="AIAlertConsolidation"}(AlertJobType||(exports.AlertJobType=AlertJobType={}));var AlertListExpandOption;!function(e){e[e.None=0]="None",e[e.Minimal=1]="Minimal",e[e.Count=2]="Count",e[e.AIMetadataBlobReference=3]="AIMetadataBlobReference"}(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",e[e.Malware=6]="Malware"}(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",e[e.FalsePositive=3]="FalsePositive",e[e.TargetFileNotFound=4]="TargetFileNotFound",e[e.CommitAuthorEmailValidationFailed=5]="CommitAuthorEmailValidationFailed"}(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",e[e.AgentPoolUnavailable=6]="AgentPoolUnavailable",e[e.BranchNotResolvable=7]="BranchNotResolvable",e[e.FalsePositive=8]="FalsePositive",e[e.TargetFileNotFound=9]="TargetFileNotFound",e[e.CommitAuthorEmailValidationFailed=10]="CommitAuthorEmailValidationFailed"}(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={}));
|
package/Alert/AlertClient.d.ts
CHANGED
|
@@ -4,10 +4,28 @@ 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
|
*/
|
|
10
18
|
getSarifContent(submissionId: number): Promise<any>;
|
|
19
|
+
/**
|
|
20
|
+
* Get the alert jobs associated with an alert.
|
|
21
|
+
*
|
|
22
|
+
* @param project - Project ID or project name
|
|
23
|
+
* @param repository - The name or ID of the repository
|
|
24
|
+
* @param alertId - The ID of the alert
|
|
25
|
+
* @param top - The maximum number of jobs to return
|
|
26
|
+
* @param continuationToken - If there are more jobs than can be returned, a continuation token is placed in the "x-ms-continuationtoken" header. Use that token here to get the next page of jobs
|
|
27
|
+
*/
|
|
28
|
+
getJobsForAlert(project: string, repository: string, alertId: number, top?: number, continuationToken?: string): Promise<WebApi.PagedList<Alert.AlertJob>>;
|
|
11
29
|
/**
|
|
12
30
|
* Get an alert.
|
|
13
31
|
*
|
|
@@ -66,6 +84,18 @@ export declare class AlertRestClient extends RestClientBase {
|
|
|
66
84
|
* @param repository - The name or ID of the repository
|
|
67
85
|
*/
|
|
68
86
|
updateAlertsBatch(request: Alert.AlertBatchStateUpdateRequest, project: string, repository: string): Promise<Alert.Alert[]>;
|
|
87
|
+
/**
|
|
88
|
+
* Query alerts for a repository by metadata type linkage.
|
|
89
|
+
*
|
|
90
|
+
* @param criteria - Metadata type filters to limit the alerts returned
|
|
91
|
+
* @param project - Project ID or project name
|
|
92
|
+
* @param repository - The name or ID of the repository
|
|
93
|
+
* @param top - The maximum number of alerts to return
|
|
94
|
+
* @param orderBy - Must be "id" "firstSeen" "lastSeen" "fixedOn" or "severity" Defaults to "id"
|
|
95
|
+
* @param expand - Options to expand the response, e.g. returning alert counts instead of alerts
|
|
96
|
+
* @param continuationToken - If there are more alerts than can be returned, a continuation token is placed in the "x-ms-continuationtoken" header. Use that token here to get the next page of alerts
|
|
97
|
+
*/
|
|
98
|
+
queryAlerts(criteria: Alert.AlertMetadataQueryCriteria, project: string, repository: string, top?: number, orderBy?: string, expand?: Alert.AlertListExpandOption, continuationToken?: string): Promise<WebApi.PagedList<Alert.Alert>>;
|
|
69
99
|
/**
|
|
70
100
|
* Returns the branches for which analysis results were submitted.
|
|
71
101
|
*
|
|
@@ -85,32 +115,41 @@ export declare class AlertRestClient extends RestClientBase {
|
|
|
85
115
|
*/
|
|
86
116
|
getUxFilters(project: string, repository: string, alertType: Alert.AlertType): Promise<Alert.UxFilters>;
|
|
87
117
|
/**
|
|
88
|
-
*
|
|
118
|
+
* Create an autofix request for the specified alert.
|
|
89
119
|
*
|
|
90
|
-
* @param callbackRequest - The callback payload containing requestId, status, and optional pullRequestId.
|
|
91
120
|
* @param project - Project ID or project name
|
|
92
|
-
* @param repository - The name or ID of the repository.
|
|
93
121
|
* @param alertId - The ID of the alert to create an autofix for.
|
|
122
|
+
* @param repository - The name or ID of the repository.
|
|
123
|
+
* @param ref - The Git ref (e.g. refs/heads/feature/x) the autofix should target.
|
|
94
124
|
*/
|
|
95
|
-
|
|
125
|
+
createAutofixRequest(project: string, alertId: number, repository: string, ref: string): Promise<Alert.AutofixRequest>;
|
|
96
126
|
/**
|
|
97
|
-
*
|
|
127
|
+
* Get all autofix requests for the specified alert.
|
|
98
128
|
*
|
|
99
129
|
* @param project - Project ID or project name
|
|
100
|
-
* @param alertId - The ID of the alert
|
|
130
|
+
* @param alertId - The ID of the alert.
|
|
101
131
|
* @param repository - The name or ID of the repository.
|
|
102
|
-
* @param ref -
|
|
132
|
+
* @param ref - The Git ref (e.g. refs/heads/feature/x) the autofix should target.
|
|
103
133
|
*/
|
|
104
|
-
|
|
134
|
+
getAutofixRequestsByAlertId(project: string, alertId: number, repository: string, ref: string): Promise<Alert.AutofixRequest[]>;
|
|
105
135
|
/**
|
|
106
|
-
*
|
|
136
|
+
* Receives a callback from the autofix pipeline with the outcome of the run. Idempotent: repeated calls for a request already in a terminal state return 200 without changes.
|
|
107
137
|
*
|
|
138
|
+
* @param callbackRequest - The callback payload containing requestId, status, and optional pullRequestId.
|
|
108
139
|
* @param project - Project ID or project name
|
|
109
|
-
* @param alertId - The ID of the alert.
|
|
110
140
|
* @param repository - The name or ID of the repository.
|
|
111
|
-
* @param ref - Optional Git ref (e.g. refs/heads/feature/x) the autofix should target. When omitted, the repository's default branch is used.
|
|
112
141
|
*/
|
|
113
|
-
|
|
142
|
+
autofixCallback(callbackRequest: Alert.AutofixCallbackRequest, project: string, repository: string): Promise<void>;
|
|
143
|
+
/**
|
|
144
|
+
* Get Draft alerts for a repository.
|
|
145
|
+
*
|
|
146
|
+
* @param project - Project ID or project name
|
|
147
|
+
* @param repository - The name or ID of the repository
|
|
148
|
+
* @param top - The maximum number of alerts to return
|
|
149
|
+
* @param orderBy - Must be "id", "firstSeen", "lastSeen", "fixedOn", or "severity". Defaults to "id"
|
|
150
|
+
* @param continuationToken - If there are more alerts than can be returned, a continuation token is placed in the "x-ms-continuationtoken" header. Use that token here to get the next page of alerts
|
|
151
|
+
*/
|
|
152
|
+
getDraftAlerts(project: string, repository: string, top?: number, orderBy?: string, continuationToken?: string): Promise<WebApi.PagedList<Alert.Alert>>;
|
|
114
153
|
/**
|
|
115
154
|
* Upload a SARIF to GitHub Code Scanning via a GitOps app.
|
|
116
155
|
*
|
|
@@ -130,6 +169,31 @@ export declare class AlertRestClient extends RestClientBase {
|
|
|
130
169
|
* @param ref -
|
|
131
170
|
*/
|
|
132
171
|
getAlertInstances(project: string, alertId: number, repository: string, ref?: string): Promise<Alert.AlertAnalysisInstance[]>;
|
|
172
|
+
/**
|
|
173
|
+
* Create an alert job.
|
|
174
|
+
*
|
|
175
|
+
* @param body -
|
|
176
|
+
* @param project - Project ID or project name
|
|
177
|
+
* @param repository - The name or ID of the repository
|
|
178
|
+
*/
|
|
179
|
+
createJob(body: any, project: string, repository: string): Promise<Alert.AlertJob>;
|
|
180
|
+
/**
|
|
181
|
+
* Get an alert job by ID.
|
|
182
|
+
*
|
|
183
|
+
* @param project - Project ID or project name
|
|
184
|
+
* @param repository - The name or ID of the repository
|
|
185
|
+
* @param jobId - The provider-assigned job identifier
|
|
186
|
+
*/
|
|
187
|
+
getJob(project: string, repository: string, jobId: string): Promise<Alert.AlertJob>;
|
|
188
|
+
/**
|
|
189
|
+
* Update an alert job.
|
|
190
|
+
*
|
|
191
|
+
* @param patch - The patch describing the fields to update
|
|
192
|
+
* @param project - Project ID or project name
|
|
193
|
+
* @param repository - The name or ID of the repository
|
|
194
|
+
* @param jobId - The provider-assigned job identifier
|
|
195
|
+
*/
|
|
196
|
+
updateJob(patch: any, project: string, repository: string, jobId: string): Promise<Alert.AlertJob>;
|
|
133
197
|
/**
|
|
134
198
|
* Create legal review. This creates the legal review associated with the alert. It include the review work item url.
|
|
135
199
|
*
|
package/Alert/AlertClient.js
CHANGED
|
@@ -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
|
*/
|
|
@@ -35,6 +55,38 @@ class AlertRestClient extends RestClientBase_1.RestClientBase {
|
|
|
35
55
|
});
|
|
36
56
|
});
|
|
37
57
|
}
|
|
58
|
+
/**
|
|
59
|
+
* Get the alert jobs associated with an alert.
|
|
60
|
+
*
|
|
61
|
+
* @param project - Project ID or project name
|
|
62
|
+
* @param repository - The name or ID of the repository
|
|
63
|
+
* @param alertId - The ID of the alert
|
|
64
|
+
* @param top - The maximum number of jobs to return
|
|
65
|
+
* @param continuationToken - If there are more jobs than can be returned, a continuation token is placed in the "x-ms-continuationtoken" header. Use that token here to get the next page of jobs
|
|
66
|
+
*/
|
|
67
|
+
getJobsForAlert(project, repository, alertId, top, continuationToken) {
|
|
68
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
69
|
+
const queryValues = {
|
|
70
|
+
top: top,
|
|
71
|
+
continuationToken: continuationToken
|
|
72
|
+
};
|
|
73
|
+
return this.beginRequest({
|
|
74
|
+
apiVersion: "7.2-preview.1",
|
|
75
|
+
routeTemplate: "{project}/_apis/Alert/repositories/{repository}/alerts/{alertId}/jobs",
|
|
76
|
+
routeValues: {
|
|
77
|
+
project: project,
|
|
78
|
+
repository: repository,
|
|
79
|
+
alertId: alertId
|
|
80
|
+
},
|
|
81
|
+
queryParams: queryValues,
|
|
82
|
+
returnRawResponse: true
|
|
83
|
+
}).then((response) => __awaiter(this, void 0, void 0, function* () {
|
|
84
|
+
const body = yield response.text().then(Serialization_1.deserializeVssJsonObject);
|
|
85
|
+
body.continuationToken = response.headers.get("x-ms-continuationtoken");
|
|
86
|
+
return body;
|
|
87
|
+
}));
|
|
88
|
+
});
|
|
89
|
+
}
|
|
38
90
|
/**
|
|
39
91
|
* Get an alert.
|
|
40
92
|
*
|
|
@@ -195,6 +247,43 @@ class AlertRestClient extends RestClientBase_1.RestClientBase {
|
|
|
195
247
|
});
|
|
196
248
|
});
|
|
197
249
|
}
|
|
250
|
+
/**
|
|
251
|
+
* Query alerts for a repository by metadata type linkage.
|
|
252
|
+
*
|
|
253
|
+
* @param criteria - Metadata type filters to limit the alerts returned
|
|
254
|
+
* @param project - Project ID or project name
|
|
255
|
+
* @param repository - The name or ID of the repository
|
|
256
|
+
* @param top - The maximum number of alerts to return
|
|
257
|
+
* @param orderBy - Must be "id" "firstSeen" "lastSeen" "fixedOn" or "severity" Defaults to "id"
|
|
258
|
+
* @param expand - Options to expand the response, e.g. returning alert counts instead of alerts
|
|
259
|
+
* @param continuationToken - If there are more alerts than can be returned, a continuation token is placed in the "x-ms-continuationtoken" header. Use that token here to get the next page of alerts
|
|
260
|
+
*/
|
|
261
|
+
queryAlerts(criteria, project, repository, top, orderBy, expand, continuationToken) {
|
|
262
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
263
|
+
const queryValues = {
|
|
264
|
+
top: top,
|
|
265
|
+
orderBy: orderBy,
|
|
266
|
+
expand: expand,
|
|
267
|
+
continuationToken: continuationToken
|
|
268
|
+
};
|
|
269
|
+
return this.beginRequest({
|
|
270
|
+
apiVersion: "7.2-preview.1",
|
|
271
|
+
method: "POST",
|
|
272
|
+
routeTemplate: "{project}/_apis/Alert/repositories/{repository}/alertsquery",
|
|
273
|
+
routeValues: {
|
|
274
|
+
project: project,
|
|
275
|
+
repository: repository
|
|
276
|
+
},
|
|
277
|
+
queryParams: queryValues,
|
|
278
|
+
body: criteria,
|
|
279
|
+
returnRawResponse: true
|
|
280
|
+
}).then((response) => __awaiter(this, void 0, void 0, function* () {
|
|
281
|
+
const body = yield response.text().then(Serialization_1.deserializeVssJsonObject);
|
|
282
|
+
body.continuationToken = response.headers.get("x-ms-continuationtoken");
|
|
283
|
+
return body;
|
|
284
|
+
}));
|
|
285
|
+
});
|
|
286
|
+
}
|
|
198
287
|
/**
|
|
199
288
|
* Returns the branches for which analysis results were submitted.
|
|
200
289
|
*
|
|
@@ -250,45 +339,47 @@ class AlertRestClient extends RestClientBase_1.RestClientBase {
|
|
|
250
339
|
});
|
|
251
340
|
}
|
|
252
341
|
/**
|
|
253
|
-
*
|
|
342
|
+
* Create an autofix request for the specified alert.
|
|
254
343
|
*
|
|
255
|
-
* @param callbackRequest - The callback payload containing requestId, status, and optional pullRequestId.
|
|
256
344
|
* @param project - Project ID or project name
|
|
257
|
-
* @param repository - The name or ID of the repository.
|
|
258
345
|
* @param alertId - The ID of the alert to create an autofix for.
|
|
346
|
+
* @param repository - The name or ID of the repository.
|
|
347
|
+
* @param ref - The Git ref (e.g. refs/heads/feature/x) the autofix should target.
|
|
259
348
|
*/
|
|
260
|
-
|
|
349
|
+
createAutofixRequest(project, alertId, repository, ref) {
|
|
261
350
|
return __awaiter(this, void 0, void 0, function* () {
|
|
351
|
+
const queryValues = {
|
|
352
|
+
ref: ref
|
|
353
|
+
};
|
|
262
354
|
return this.beginRequest({
|
|
263
355
|
apiVersion: "7.2-preview.1",
|
|
264
356
|
method: "POST",
|
|
265
357
|
routeTemplate: "{project}/_apis/Alert/repositories/{repository}/alerts/{alertId}/Autofix/{action}",
|
|
266
358
|
routeValues: {
|
|
267
359
|
project: project,
|
|
268
|
-
repository: repository,
|
|
269
360
|
alertId: alertId,
|
|
270
|
-
|
|
361
|
+
repository: repository,
|
|
362
|
+
action: "Default"
|
|
271
363
|
},
|
|
272
|
-
|
|
364
|
+
queryParams: queryValues
|
|
273
365
|
});
|
|
274
366
|
});
|
|
275
367
|
}
|
|
276
368
|
/**
|
|
277
|
-
*
|
|
369
|
+
* Get all autofix requests for the specified alert.
|
|
278
370
|
*
|
|
279
371
|
* @param project - Project ID or project name
|
|
280
|
-
* @param alertId - The ID of the alert
|
|
372
|
+
* @param alertId - The ID of the alert.
|
|
281
373
|
* @param repository - The name or ID of the repository.
|
|
282
|
-
* @param ref -
|
|
374
|
+
* @param ref - The Git ref (e.g. refs/heads/feature/x) the autofix should target.
|
|
283
375
|
*/
|
|
284
|
-
|
|
376
|
+
getAutofixRequestsByAlertId(project, alertId, repository, ref) {
|
|
285
377
|
return __awaiter(this, void 0, void 0, function* () {
|
|
286
378
|
const queryValues = {
|
|
287
379
|
ref: ref
|
|
288
380
|
};
|
|
289
381
|
return this.beginRequest({
|
|
290
382
|
apiVersion: "7.2-preview.1",
|
|
291
|
-
method: "POST",
|
|
292
383
|
routeTemplate: "{project}/_apis/Alert/repositories/{repository}/alerts/{alertId}/Autofix/{action}",
|
|
293
384
|
routeValues: {
|
|
294
385
|
project: project,
|
|
@@ -301,29 +392,56 @@ class AlertRestClient extends RestClientBase_1.RestClientBase {
|
|
|
301
392
|
});
|
|
302
393
|
}
|
|
303
394
|
/**
|
|
304
|
-
*
|
|
395
|
+
* Receives a callback from the autofix pipeline with the outcome of the run. Idempotent: repeated calls for a request already in a terminal state return 200 without changes.
|
|
305
396
|
*
|
|
397
|
+
* @param callbackRequest - The callback payload containing requestId, status, and optional pullRequestId.
|
|
306
398
|
* @param project - Project ID or project name
|
|
307
|
-
* @param alertId - The ID of the alert.
|
|
308
399
|
* @param repository - The name or ID of the repository.
|
|
309
|
-
* @param ref - Optional Git ref (e.g. refs/heads/feature/x) the autofix should target. When omitted, the repository's default branch is used.
|
|
310
400
|
*/
|
|
311
|
-
|
|
401
|
+
autofixCallback(callbackRequest, project, repository) {
|
|
402
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
403
|
+
return this.beginRequest({
|
|
404
|
+
apiVersion: "7.2-preview.1",
|
|
405
|
+
method: "POST",
|
|
406
|
+
routeTemplate: "{project}/_apis/Alert/repositories/{repository}/autofix/callback",
|
|
407
|
+
routeValues: {
|
|
408
|
+
project: project,
|
|
409
|
+
repository: repository
|
|
410
|
+
},
|
|
411
|
+
body: callbackRequest
|
|
412
|
+
});
|
|
413
|
+
});
|
|
414
|
+
}
|
|
415
|
+
/**
|
|
416
|
+
* Get Draft alerts for a repository.
|
|
417
|
+
*
|
|
418
|
+
* @param project - Project ID or project name
|
|
419
|
+
* @param repository - The name or ID of the repository
|
|
420
|
+
* @param top - The maximum number of alerts to return
|
|
421
|
+
* @param orderBy - Must be "id", "firstSeen", "lastSeen", "fixedOn", or "severity". Defaults to "id"
|
|
422
|
+
* @param continuationToken - If there are more alerts than can be returned, a continuation token is placed in the "x-ms-continuationtoken" header. Use that token here to get the next page of alerts
|
|
423
|
+
*/
|
|
424
|
+
getDraftAlerts(project, repository, top, orderBy, continuationToken) {
|
|
312
425
|
return __awaiter(this, void 0, void 0, function* () {
|
|
313
426
|
const queryValues = {
|
|
314
|
-
|
|
427
|
+
top: top,
|
|
428
|
+
orderBy: orderBy,
|
|
429
|
+
continuationToken: continuationToken
|
|
315
430
|
};
|
|
316
431
|
return this.beginRequest({
|
|
317
432
|
apiVersion: "7.2-preview.1",
|
|
318
|
-
routeTemplate: "{project}/_apis/Alert/repositories/{repository}/
|
|
433
|
+
routeTemplate: "{project}/_apis/Alert/repositories/{repository}/draftAlerts",
|
|
319
434
|
routeValues: {
|
|
320
435
|
project: project,
|
|
321
|
-
|
|
322
|
-
repository: repository,
|
|
323
|
-
action: "Default"
|
|
436
|
+
repository: repository
|
|
324
437
|
},
|
|
325
|
-
queryParams: queryValues
|
|
326
|
-
|
|
438
|
+
queryParams: queryValues,
|
|
439
|
+
returnRawResponse: true
|
|
440
|
+
}).then((response) => __awaiter(this, void 0, void 0, function* () {
|
|
441
|
+
const body = yield response.text().then(Serialization_1.deserializeVssJsonObject);
|
|
442
|
+
body.continuationToken = response.headers.get("x-ms-continuationtoken");
|
|
443
|
+
return body;
|
|
444
|
+
}));
|
|
327
445
|
});
|
|
328
446
|
}
|
|
329
447
|
/**
|
|
@@ -379,6 +497,70 @@ class AlertRestClient extends RestClientBase_1.RestClientBase {
|
|
|
379
497
|
});
|
|
380
498
|
});
|
|
381
499
|
}
|
|
500
|
+
/**
|
|
501
|
+
* Create an alert job.
|
|
502
|
+
*
|
|
503
|
+
* @param body -
|
|
504
|
+
* @param project - Project ID or project name
|
|
505
|
+
* @param repository - The name or ID of the repository
|
|
506
|
+
*/
|
|
507
|
+
createJob(body, project, repository) {
|
|
508
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
509
|
+
return this.beginRequest({
|
|
510
|
+
apiVersion: "7.2-preview.1",
|
|
511
|
+
method: "POST",
|
|
512
|
+
routeTemplate: "{project}/_apis/Alert/repositories/{repository}/jobs/{jobId}",
|
|
513
|
+
routeValues: {
|
|
514
|
+
project: project,
|
|
515
|
+
repository: repository
|
|
516
|
+
},
|
|
517
|
+
body: body
|
|
518
|
+
});
|
|
519
|
+
});
|
|
520
|
+
}
|
|
521
|
+
/**
|
|
522
|
+
* Get an alert job by ID.
|
|
523
|
+
*
|
|
524
|
+
* @param project - Project ID or project name
|
|
525
|
+
* @param repository - The name or ID of the repository
|
|
526
|
+
* @param jobId - The provider-assigned job identifier
|
|
527
|
+
*/
|
|
528
|
+
getJob(project, repository, jobId) {
|
|
529
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
530
|
+
return this.beginRequest({
|
|
531
|
+
apiVersion: "7.2-preview.1",
|
|
532
|
+
routeTemplate: "{project}/_apis/Alert/repositories/{repository}/jobs/{jobId}",
|
|
533
|
+
routeValues: {
|
|
534
|
+
project: project,
|
|
535
|
+
repository: repository,
|
|
536
|
+
jobId: jobId
|
|
537
|
+
}
|
|
538
|
+
});
|
|
539
|
+
});
|
|
540
|
+
}
|
|
541
|
+
/**
|
|
542
|
+
* Update an alert job.
|
|
543
|
+
*
|
|
544
|
+
* @param patch - The patch describing the fields to update
|
|
545
|
+
* @param project - Project ID or project name
|
|
546
|
+
* @param repository - The name or ID of the repository
|
|
547
|
+
* @param jobId - The provider-assigned job identifier
|
|
548
|
+
*/
|
|
549
|
+
updateJob(patch, project, repository, jobId) {
|
|
550
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
551
|
+
return this.beginRequest({
|
|
552
|
+
apiVersion: "7.2-preview.1",
|
|
553
|
+
method: "PATCH",
|
|
554
|
+
routeTemplate: "{project}/_apis/Alert/repositories/{repository}/jobs/{jobId}",
|
|
555
|
+
routeValues: {
|
|
556
|
+
project: project,
|
|
557
|
+
repository: repository,
|
|
558
|
+
jobId: jobId
|
|
559
|
+
},
|
|
560
|
+
body: patch
|
|
561
|
+
});
|
|
562
|
+
});
|
|
563
|
+
}
|
|
382
564
|
/**
|
|
383
565
|
* Create legal review. This creates the legal review associated with the alert. It include the review work item url.
|
|
384
566
|
*
|