azure-devops-extension-api 5.272.2 → 5.273.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 +64 -1
- package/Alert/Alert.js +42 -1
- package/Alert/Alert.min.js +1 -1
- package/Alert/AlertClient.d.ts +17 -0
- package/Alert/AlertClient.js +48 -2
- package/Alert/AlertClient.min.js +1 -1
- package/Git/GitClient.d.ts +6 -0
- package/Git/GitClient.js +18 -0
- package/Git/GitClient.min.js +1 -1
- package/Management/Management.d.ts +8 -0
- package/TaskAgent/TaskAgent.d.ts +151 -0
- package/TaskAgent/TaskAgent.js +20 -2
- package/TaskAgent/TaskAgent.min.js +1 -1
- package/TaskAgent/TaskAgentClient.d.ts +8 -0
- package/TaskAgent/TaskAgentClient.js +21 -0
- package/TaskAgent/TaskAgentClient.min.js +1 -1
- package/Test/Test.d.ts +5 -1
- package/_manifest/{Spdx2xVs3xComparisonToolOutput.json → comparison-result.json} +7 -0
- package/_manifest/spdx_2.2/ESRPClientLogs0609213623913.json +1 -0
- package/_manifest/spdx_2.2/bsi.cose +0 -0
- package/_manifest/spdx_2.2/bsi.json +1 -1
- package/_manifest/spdx_2.2/manifest.cat +0 -0
- package/_manifest/spdx_2.2/manifest.spdx.cose +0 -0
- package/_manifest/spdx_2.2/manifest.spdx.json +1 -1
- package/_manifest/spdx_2.2/manifest.spdx.json.sha256 +1 -1
- package/_manifest/spdx_3.0/manifest.spdx.json +1 -1
- package/_manifest/spdx_3.0/manifest.spdx.json.sha256 +1 -1
- package/esm/Alert/Alert.js +41 -0
- package/esm/Alert/Alert.min.js +1 -1
- package/esm/Alert/AlertClient.js +44 -2
- package/esm/Alert/AlertClient.min.js +1 -1
- package/esm/Git/GitClient.js +16 -0
- package/esm/Git/GitClient.min.js +1 -1
- package/esm/TaskAgent/TaskAgent.js +18 -0
- package/esm/TaskAgent/TaskAgent.min.js +1 -1
- package/esm/TaskAgent/TaskAgentClient.js +19 -0
- package/esm/TaskAgent/TaskAgentClient.min.js +1 -1
- package/index.d.ts +0 -42
- package/package.json +3 -4
- package/_manifest/spdx_2.2/ESRPClientLogs0514185208008.json +0 -1
package/Alert/Alert.d.ts
CHANGED
|
@@ -42,6 +42,10 @@ export interface Alert {
|
|
|
42
42
|
* This value is computed and returned by the service. This value represents the first time the vulnerability was introduced.
|
|
43
43
|
*/
|
|
44
44
|
introducedDate: Date;
|
|
45
|
+
/**
|
|
46
|
+
* 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
|
+
*/
|
|
48
|
+
isAutoFixable: boolean;
|
|
45
49
|
/**
|
|
46
50
|
* 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.
|
|
47
51
|
*/
|
|
@@ -149,7 +153,11 @@ export declare enum AlertListExpandOption {
|
|
|
149
153
|
/**
|
|
150
154
|
* Return a minimal representation of an alert.
|
|
151
155
|
*/
|
|
152
|
-
Minimal = 1
|
|
156
|
+
Minimal = 1,
|
|
157
|
+
/**
|
|
158
|
+
* Return only the count of active alerts grouped by alert type.
|
|
159
|
+
*/
|
|
160
|
+
Count = 2
|
|
153
161
|
}
|
|
154
162
|
/**
|
|
155
163
|
* Alert metadata.
|
|
@@ -387,12 +395,59 @@ export interface AnalysisResult {
|
|
|
387
395
|
result: Result;
|
|
388
396
|
state: State;
|
|
389
397
|
}
|
|
398
|
+
/**
|
|
399
|
+
* Payload sent by the autofix pipeline to report the outcome of a run.
|
|
400
|
+
*/
|
|
401
|
+
export interface AutofixCallbackRequest {
|
|
402
|
+
pullRequestId: number;
|
|
403
|
+
requestId: number;
|
|
404
|
+
/**
|
|
405
|
+
* Terminal status reported by the pipeline.
|
|
406
|
+
*/
|
|
407
|
+
status: AutofixCallbackStatus;
|
|
408
|
+
}
|
|
409
|
+
export declare enum AutofixCallbackStatus {
|
|
410
|
+
/**
|
|
411
|
+
* The pipeline completed successfully and a pull request was created.
|
|
412
|
+
*/
|
|
413
|
+
Done = 0,
|
|
414
|
+
/**
|
|
415
|
+
* The pipeline or post-processing failed.
|
|
416
|
+
*/
|
|
417
|
+
Failed = 1
|
|
418
|
+
}
|
|
390
419
|
/**
|
|
391
420
|
* Represents an autofix request resource.
|
|
392
421
|
*/
|
|
393
422
|
export interface AutofixRequest {
|
|
394
423
|
createdDate: Date;
|
|
395
424
|
requestId: number;
|
|
425
|
+
status: AutofixRequestStatus;
|
|
426
|
+
}
|
|
427
|
+
/**
|
|
428
|
+
* Indicates the lifecycle status of an autofix request. Maps to TINYINT in the database.
|
|
429
|
+
*/
|
|
430
|
+
export declare enum AutofixRequestStatus {
|
|
431
|
+
/**
|
|
432
|
+
* Default sentinel value; not a valid operational status.
|
|
433
|
+
*/
|
|
434
|
+
None = 0,
|
|
435
|
+
/**
|
|
436
|
+
* The request has been created and is waiting for a pipeline to be triggered.
|
|
437
|
+
*/
|
|
438
|
+
Pending = 1,
|
|
439
|
+
/**
|
|
440
|
+
* The pipeline has been triggered and is currently running.
|
|
441
|
+
*/
|
|
442
|
+
PipelineRunning = 2,
|
|
443
|
+
/**
|
|
444
|
+
* The pipeline completed successfully and a pull request was created.
|
|
445
|
+
*/
|
|
446
|
+
Done = 3,
|
|
447
|
+
/**
|
|
448
|
+
* The pipeline or post-processing failed.
|
|
449
|
+
*/
|
|
450
|
+
Failed = 4
|
|
396
451
|
}
|
|
397
452
|
export interface Branch {
|
|
398
453
|
branchId: number;
|
|
@@ -1101,6 +1156,10 @@ export interface Tool {
|
|
|
1101
1156
|
* The rules that the tool defines
|
|
1102
1157
|
*/
|
|
1103
1158
|
rules: Rule[];
|
|
1159
|
+
/**
|
|
1160
|
+
* String representation of the tool version
|
|
1161
|
+
*/
|
|
1162
|
+
toolVersion: string;
|
|
1104
1163
|
}
|
|
1105
1164
|
export interface UxFilters {
|
|
1106
1165
|
/**
|
|
@@ -1160,6 +1219,10 @@ export interface ValidationFingerprint {
|
|
|
1160
1219
|
* Represents the CrossCompanyCorrelatingId for the secret in the ValidationFingerprintJson.
|
|
1161
1220
|
*/
|
|
1162
1221
|
c3Id: string;
|
|
1222
|
+
/**
|
|
1223
|
+
* A normalized string representation of the validation tool version.
|
|
1224
|
+
*/
|
|
1225
|
+
normalizedValidationToolVersion: number;
|
|
1163
1226
|
/**
|
|
1164
1227
|
* The hash associated to the secret.
|
|
1165
1228
|
*/
|
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.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.DependencyKind = exports.Confidence = exports.ComponentType = exports.AutofixRequestStatus = 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
|
/**
|
|
@@ -16,6 +16,10 @@ var AlertListExpandOption;
|
|
|
16
16
|
* Return a minimal representation of an alert.
|
|
17
17
|
*/
|
|
18
18
|
AlertListExpandOption[AlertListExpandOption["Minimal"] = 1] = "Minimal";
|
|
19
|
+
/**
|
|
20
|
+
* Return only the count of active alerts grouped by alert type.
|
|
21
|
+
*/
|
|
22
|
+
AlertListExpandOption[AlertListExpandOption["Count"] = 2] = "Count";
|
|
19
23
|
})(AlertListExpandOption || (exports.AlertListExpandOption = AlertListExpandOption = {}));
|
|
20
24
|
/**
|
|
21
25
|
* Enum to control error policy in a bulk get alert metadata items request.
|
|
@@ -107,6 +111,43 @@ var AnalysisConfigurationType;
|
|
|
107
111
|
*/
|
|
108
112
|
AnalysisConfigurationType[AnalysisConfigurationType["AdoPipeline"] = 1] = "AdoPipeline";
|
|
109
113
|
})(AnalysisConfigurationType || (exports.AnalysisConfigurationType = AnalysisConfigurationType = {}));
|
|
114
|
+
var AutofixCallbackStatus;
|
|
115
|
+
(function (AutofixCallbackStatus) {
|
|
116
|
+
/**
|
|
117
|
+
* The pipeline completed successfully and a pull request was created.
|
|
118
|
+
*/
|
|
119
|
+
AutofixCallbackStatus[AutofixCallbackStatus["Done"] = 0] = "Done";
|
|
120
|
+
/**
|
|
121
|
+
* The pipeline or post-processing failed.
|
|
122
|
+
*/
|
|
123
|
+
AutofixCallbackStatus[AutofixCallbackStatus["Failed"] = 1] = "Failed";
|
|
124
|
+
})(AutofixCallbackStatus || (exports.AutofixCallbackStatus = AutofixCallbackStatus = {}));
|
|
125
|
+
/**
|
|
126
|
+
* Indicates the lifecycle status of an autofix request. Maps to TINYINT in the database.
|
|
127
|
+
*/
|
|
128
|
+
var AutofixRequestStatus;
|
|
129
|
+
(function (AutofixRequestStatus) {
|
|
130
|
+
/**
|
|
131
|
+
* Default sentinel value; not a valid operational status.
|
|
132
|
+
*/
|
|
133
|
+
AutofixRequestStatus[AutofixRequestStatus["None"] = 0] = "None";
|
|
134
|
+
/**
|
|
135
|
+
* The request has been created and is waiting for a pipeline to be triggered.
|
|
136
|
+
*/
|
|
137
|
+
AutofixRequestStatus[AutofixRequestStatus["Pending"] = 1] = "Pending";
|
|
138
|
+
/**
|
|
139
|
+
* The pipeline has been triggered and is currently running.
|
|
140
|
+
*/
|
|
141
|
+
AutofixRequestStatus[AutofixRequestStatus["PipelineRunning"] = 2] = "PipelineRunning";
|
|
142
|
+
/**
|
|
143
|
+
* The pipeline completed successfully and a pull request was created.
|
|
144
|
+
*/
|
|
145
|
+
AutofixRequestStatus[AutofixRequestStatus["Done"] = 3] = "Done";
|
|
146
|
+
/**
|
|
147
|
+
* The pipeline or post-processing failed.
|
|
148
|
+
*/
|
|
149
|
+
AutofixRequestStatus[AutofixRequestStatus["Failed"] = 4] = "Failed";
|
|
150
|
+
})(AutofixRequestStatus || (exports.AutofixRequestStatus = AutofixRequestStatus = {}));
|
|
110
151
|
/**
|
|
111
152
|
* This enum defines the dependency components.
|
|
112
153
|
*/
|
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.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"}(AlertListExpandOption||(exports.AlertListExpandOption=AlertListExpandOption={}));var AlertMetadataErrorPolicy;!function(e){e[e.Fail=1]="Fail",e[e.Omit=2]="Omit"}(AlertMetadataErrorPolicy||(exports.AlertMetadataErrorPolicy=AlertMetadataErrorPolicy={}));var AlertType;!function(e){e[e.Unknown=0]="Unknown",e[e.Dependency=1]="Dependency",e[e.Secret=2]="Secret",e[e.Code=3]="Code",e[e.License=4]="License"}(AlertType||(exports.AlertType=AlertType={}));var AlertValidationRequestStatus;!function(e){e[e.None=0]="None",e[e.Created=1]="Created",e[e.InProgress=2]="InProgress",e[e.Completed=3]="Completed",e[e.Failed=4]="Failed"}(AlertValidationRequestStatus||(exports.AlertValidationRequestStatus=AlertValidationRequestStatus={}));var AlertValidityStatus;!function(e){e[e.None=0]="None",e[e.Unknown=1]="Unknown",e[e.Active=2]="Active",e[e.Inactive=3]="Inactive"}(AlertValidityStatus||(exports.AlertValidityStatus=AlertValidityStatus={}));var AnalysisConfigurationType;!function(e){e[e.Default=0]="Default",e[e.AdoPipeline=1]="AdoPipeline"}(AnalysisConfigurationType||(exports.AnalysisConfigurationType=AnalysisConfigurationType={}));var 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"}(SarifJobStatus||(exports.SarifJobStatus=SarifJobStatus={}));var Severity;!function(e){e[e.Low=0]="Low",e[e.Medium=1]="Medium",e[e.High=2]="High",e[e.Critical=3]="Critical",e[e.Note=4]="Note",e[e.Warning=5]="Warning",e[e.Error=6]="Error",e[e.Undefined=7]="Undefined"}(Severity||(exports.Severity=Severity={}));var State;!function(e){e[e.Unknown=0]="Unknown",e[e.Active=1]="Active",e[e.Dismissed=2]="Dismissed",e[e.Fixed=4]="Fixed",e[e.AutoDismissed=8]="AutoDismissed"}(State||(exports.State=State={}));var ValidationResult;!function(e){e[e.None=0]="None",e[e.Exploitable=1]="Exploitable",e[e.NotExploitable=2]="NotExploitable",e[e.Inconclusive=3]="Inconclusive",e[e.ValidationNotSupported=4]="ValidationNotSupported",e[e.TransientError=5]="TransientError"}(ValidationResult||(exports.ValidationResult=ValidationResult={}));
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ValidationResult=exports.State=exports.Severity=exports.SarifJobStatus=exports.ResultType=exports.MetadataOperation=exports.MetadataChangeType=exports.LicenseType=exports.LicenseState=exports.ExpandOption=exports.DismissalType=exports.DependencyKind=exports.Confidence=exports.ComponentType=exports.AutofixRequestStatus=exports.AutofixCallbackStatus=exports.AnalysisConfigurationType=exports.AlertValidityStatus=exports.AlertValidationRequestStatus=exports.AlertType=exports.AlertMetadataErrorPolicy=exports.AlertListExpandOption=void 0;var AlertListExpandOption;!function(e){e[e.None=0]="None",e[e.Minimal=1]="Minimal",e[e.Count=2]="Count"}(AlertListExpandOption||(exports.AlertListExpandOption=AlertListExpandOption={}));var AlertMetadataErrorPolicy;!function(e){e[e.Fail=1]="Fail",e[e.Omit=2]="Omit"}(AlertMetadataErrorPolicy||(exports.AlertMetadataErrorPolicy=AlertMetadataErrorPolicy={}));var AlertType;!function(e){e[e.Unknown=0]="Unknown",e[e.Dependency=1]="Dependency",e[e.Secret=2]="Secret",e[e.Code=3]="Code",e[e.License=4]="License"}(AlertType||(exports.AlertType=AlertType={}));var AlertValidationRequestStatus;!function(e){e[e.None=0]="None",e[e.Created=1]="Created",e[e.InProgress=2]="InProgress",e[e.Completed=3]="Completed",e[e.Failed=4]="Failed"}(AlertValidationRequestStatus||(exports.AlertValidationRequestStatus=AlertValidationRequestStatus={}));var AlertValidityStatus;!function(e){e[e.None=0]="None",e[e.Unknown=1]="Unknown",e[e.Active=2]="Active",e[e.Inactive=3]="Inactive"}(AlertValidityStatus||(exports.AlertValidityStatus=AlertValidityStatus={}));var AnalysisConfigurationType;!function(e){e[e.Default=0]="Default",e[e.AdoPipeline=1]="AdoPipeline"}(AnalysisConfigurationType||(exports.AnalysisConfigurationType=AnalysisConfigurationType={}));var AutofixCallbackStatus;!function(e){e[e.Done=0]="Done",e[e.Failed=1]="Failed"}(AutofixCallbackStatus||(exports.AutofixCallbackStatus=AutofixCallbackStatus={}));var AutofixRequestStatus;!function(e){e[e.None=0]="None",e[e.Pending=1]="Pending",e[e.PipelineRunning=2]="PipelineRunning",e[e.Done=3]="Done",e[e.Failed=4]="Failed"}(AutofixRequestStatus||(exports.AutofixRequestStatus=AutofixRequestStatus={}));var ComponentType;!function(e){e[e.Unknown=0]="Unknown",e[e.NuGet=1]="NuGet",e[e.Npm=2]="Npm",e[e.Maven=3]="Maven",e[e.Git=4]="Git",e[e.Other=5]="Other",e[e.RubyGems=6]="RubyGems",e[e.Cargo=7]="Cargo",e[e.Pip=8]="Pip",e[e.File=9]="File",e[e.Go=10]="Go",e[e.DockerImage=11]="DockerImage",e[e.Pod=12]="Pod",e[e.Linux=13]="Linux",e[e.Conda=14]="Conda",e[e.DockerReference=15]="DockerReference",e[e.Vcpkg=16]="Vcpkg"}(ComponentType||(exports.ComponentType=ComponentType={}));var Confidence;!function(e){e[e.High=0]="High",e[e.Other=1]="Other"}(Confidence||(exports.Confidence=Confidence={}));var DependencyKind;!function(e){e[e.Unknown=0]="Unknown",e[e.RootDependency=1]="RootDependency",e[e.Component=2]="Component",e[e.VulnerableDependency=3]="VulnerableDependency"}(DependencyKind||(exports.DependencyKind=DependencyKind={}));var DismissalType;!function(e){e[e.Unknown=0]="Unknown",e[e.Fixed=1]="Fixed",e[e.AcceptedRisk=2]="AcceptedRisk",e[e.FalsePositive=3]="FalsePositive",e[e.AgreedToGuidance=4]="AgreedToGuidance",e[e.ToolUpgrade=5]="ToolUpgrade",e[e.NotDistributed=6]="NotDistributed"}(DismissalType||(exports.DismissalType=DismissalType={}));var ExpandOption;!function(e){e[e.None=0]="None",e[e.ValidationFingerprint=1]="ValidationFingerprint"}(ExpandOption||(exports.ExpandOption=ExpandOption={}));var LicenseState;!function(e){e[e.Unknown=0]="Unknown",e[e.NotHarvested=1]="NotHarvested",e[e.Harvested=2]="Harvested"}(LicenseState||(exports.LicenseState=LicenseState={}));var LicenseType;!function(e){e[e.Unknown=0]="Unknown",e[e.Permissive=1]="Permissive",e[e.WeakCopyleft=2]="WeakCopyleft",e[e.StrongCopyleft=3]="StrongCopyleft",e[e.NetworkCopyleft=4]="NetworkCopyleft",e[e.Other=5]="Other",e[e.NoAssertion=6]="NoAssertion"}(LicenseType||(exports.LicenseType=LicenseType={}));var MetadataChangeType;!function(e){e[e.None=0]="None",e[e.Created=1]="Created",e[e.Updated=2]="Updated",e[e.Deleted=3]="Deleted"}(MetadataChangeType||(exports.MetadataChangeType=MetadataChangeType={}));var MetadataOperation;!function(e){e[e.None=0]="None",e[e.Add=1]="Add",e[e.Remove=2]="Remove"}(MetadataOperation||(exports.MetadataOperation=MetadataOperation={}));var ResultType;!function(e){e[e.Unknown=0]="Unknown",e[e.Dependency=1]="Dependency",e[e.VersionControl=2]="VersionControl"}(ResultType||(exports.ResultType=ResultType={}));var SarifJobStatus;!function(e){e[e.New=0]="New",e[e.Queued=1]="Queued",e[e.Completed=2]="Completed",e[e.Failed=3]="Failed",e[e.Requeued=4]="Requeued"}(SarifJobStatus||(exports.SarifJobStatus=SarifJobStatus={}));var Severity;!function(e){e[e.Low=0]="Low",e[e.Medium=1]="Medium",e[e.High=2]="High",e[e.Critical=3]="Critical",e[e.Note=4]="Note",e[e.Warning=5]="Warning",e[e.Error=6]="Error",e[e.Undefined=7]="Undefined"}(Severity||(exports.Severity=Severity={}));var State;!function(e){e[e.Unknown=0]="Unknown",e[e.Active=1]="Active",e[e.Dismissed=2]="Dismissed",e[e.Fixed=4]="Fixed",e[e.AutoDismissed=8]="AutoDismissed"}(State||(exports.State=State={}));var ValidationResult;!function(e){e[e.None=0]="None",e[e.Exploitable=1]="Exploitable",e[e.NotExploitable=2]="NotExploitable",e[e.Inconclusive=3]="Inconclusive",e[e.ValidationNotSupported=4]="ValidationNotSupported",e[e.TransientError=5]="TransientError"}(ValidationResult||(exports.ValidationResult=ValidationResult={}));
|
package/Alert/AlertClient.d.ts
CHANGED
|
@@ -71,6 +71,15 @@ export declare class AlertRestClient extends RestClientBase {
|
|
|
71
71
|
* @param alertType -
|
|
72
72
|
*/
|
|
73
73
|
getUxFilters(project: string, repository: string, alertType: Alert.AlertType): Promise<Alert.UxFilters>;
|
|
74
|
+
/**
|
|
75
|
+
* 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.
|
|
76
|
+
*
|
|
77
|
+
* @param callbackRequest - The callback payload containing requestId, status, and optional pullRequestId.
|
|
78
|
+
* @param project - Project ID or project name
|
|
79
|
+
* @param repository - The name or ID of the repository.
|
|
80
|
+
* @param alertId - The ID of the alert to create an autofix for.
|
|
81
|
+
*/
|
|
82
|
+
autofixCallback(callbackRequest: Alert.AutofixCallbackRequest, project: string, repository: string, alertId: number): Promise<void>;
|
|
74
83
|
/**
|
|
75
84
|
* Create an autofix request for the specified alert.
|
|
76
85
|
*
|
|
@@ -79,6 +88,14 @@ export declare class AlertRestClient extends RestClientBase {
|
|
|
79
88
|
* @param repository - The name or ID of the repository.
|
|
80
89
|
*/
|
|
81
90
|
createAutofixRequest(project: string, alertId: number, repository: string): Promise<Alert.AutofixRequest>;
|
|
91
|
+
/**
|
|
92
|
+
* Get all autofix requests for the specified alert.
|
|
93
|
+
*
|
|
94
|
+
* @param project - Project ID or project name
|
|
95
|
+
* @param alertId - The ID of the alert.
|
|
96
|
+
* @param repository - The name or ID of the repository.
|
|
97
|
+
*/
|
|
98
|
+
getAutofixRequestsByAlertId(project: string, alertId: number, repository: string): Promise<Alert.AutofixRequest[]>;
|
|
82
99
|
/**
|
|
83
100
|
* Upload a SARIF to GitHub Code Scanning via a GitOps app.
|
|
84
101
|
*
|
package/Alert/AlertClient.js
CHANGED
|
@@ -209,6 +209,30 @@ class AlertRestClient extends RestClientBase_1.RestClientBase {
|
|
|
209
209
|
});
|
|
210
210
|
});
|
|
211
211
|
}
|
|
212
|
+
/**
|
|
213
|
+
* 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.
|
|
214
|
+
*
|
|
215
|
+
* @param callbackRequest - The callback payload containing requestId, status, and optional pullRequestId.
|
|
216
|
+
* @param project - Project ID or project name
|
|
217
|
+
* @param repository - The name or ID of the repository.
|
|
218
|
+
* @param alertId - The ID of the alert to create an autofix for.
|
|
219
|
+
*/
|
|
220
|
+
autofixCallback(callbackRequest, project, repository, alertId) {
|
|
221
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
222
|
+
return this.beginRequest({
|
|
223
|
+
apiVersion: "7.2-preview.1",
|
|
224
|
+
method: "POST",
|
|
225
|
+
routeTemplate: "{project}/_apis/Alert/repositories/{repository}/alerts/{alertId}/Autofix/{action}",
|
|
226
|
+
routeValues: {
|
|
227
|
+
project: project,
|
|
228
|
+
repository: repository,
|
|
229
|
+
alertId: alertId,
|
|
230
|
+
action: "Callback"
|
|
231
|
+
},
|
|
232
|
+
body: callbackRequest
|
|
233
|
+
});
|
|
234
|
+
});
|
|
235
|
+
}
|
|
212
236
|
/**
|
|
213
237
|
* Create an autofix request for the specified alert.
|
|
214
238
|
*
|
|
@@ -221,11 +245,33 @@ class AlertRestClient extends RestClientBase_1.RestClientBase {
|
|
|
221
245
|
return this.beginRequest({
|
|
222
246
|
apiVersion: "7.2-preview.1",
|
|
223
247
|
method: "POST",
|
|
224
|
-
routeTemplate: "{project}/_apis/Alert/repositories/{repository}/alerts/{alertId}/Autofix",
|
|
248
|
+
routeTemplate: "{project}/_apis/Alert/repositories/{repository}/alerts/{alertId}/Autofix/{action}",
|
|
225
249
|
routeValues: {
|
|
226
250
|
project: project,
|
|
227
251
|
alertId: alertId,
|
|
228
|
-
repository: repository
|
|
252
|
+
repository: repository,
|
|
253
|
+
action: "Default"
|
|
254
|
+
}
|
|
255
|
+
});
|
|
256
|
+
});
|
|
257
|
+
}
|
|
258
|
+
/**
|
|
259
|
+
* Get all autofix requests for the specified alert.
|
|
260
|
+
*
|
|
261
|
+
* @param project - Project ID or project name
|
|
262
|
+
* @param alertId - The ID of the alert.
|
|
263
|
+
* @param repository - The name or ID of the repository.
|
|
264
|
+
*/
|
|
265
|
+
getAutofixRequestsByAlertId(project, alertId, repository) {
|
|
266
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
267
|
+
return this.beginRequest({
|
|
268
|
+
apiVersion: "7.2-preview.1",
|
|
269
|
+
routeTemplate: "{project}/_apis/Alert/repositories/{repository}/alerts/{alertId}/Autofix/{action}",
|
|
270
|
+
routeValues: {
|
|
271
|
+
project: project,
|
|
272
|
+
alertId: alertId,
|
|
273
|
+
repository: repository,
|
|
274
|
+
action: "Default"
|
|
229
275
|
}
|
|
230
276
|
});
|
|
231
277
|
});
|
package/Alert/AlertClient.min.js
CHANGED
|
@@ -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)}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){return __awaiter(this,void 0,void 0,function*(){return this.beginRequest({apiVersion:"7.2-preview.1",method:"POST",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})})}createAutofixRequest(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}/Autofix",routeValues:{project:e,alertId:t,repository:r}})})}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)}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){return __awaiter(this,void 0,void 0,function*(){return this.beginRequest({apiVersion:"7.2-preview.1",method:"POST",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){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:e,alertId:t,repository:r,action:"Default"}})})}getAutofixRequestsByAlertId(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}/Autofix/{action}",routeValues:{project:e,alertId:t,repository:r,action:"Default"}})})}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;
|
package/Git/GitClient.d.ts
CHANGED
|
@@ -6,6 +6,12 @@ import * as WebApi from "../WebApi/WebApi";
|
|
|
6
6
|
export declare class GitRestClient extends RestClientBase {
|
|
7
7
|
constructor(options: IVssRestClientOptions);
|
|
8
8
|
static readonly RESOURCE_AREA_ID = "4e080c62-fa21-4fbc-8fef-2a10a2b38049";
|
|
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.
|
|
11
|
+
*
|
|
12
|
+
* @param projectId - Optional project GUID. When omitted, all projects in the organization are initialized.
|
|
13
|
+
*/
|
|
14
|
+
initializeAutofixIdentity(projectId?: string): Promise<void>;
|
|
9
15
|
/**
|
|
10
16
|
* DELETE Deletes Enablement status and BillableCommitters data from DB. Deleting the enablement data will effectively disable it for the repositories affected.
|
|
11
17
|
*
|
package/Git/GitClient.js
CHANGED
|
@@ -21,6 +21,24 @@ class GitRestClient extends RestClientBase_1.RestClientBase {
|
|
|
21
21
|
constructor(options) {
|
|
22
22
|
super(options);
|
|
23
23
|
}
|
|
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.
|
|
26
|
+
*
|
|
27
|
+
* @param projectId - Optional project GUID. When omitted, all projects in the organization are initialized.
|
|
28
|
+
*/
|
|
29
|
+
initializeAutofixIdentity(projectId) {
|
|
30
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
31
|
+
const queryValues = {
|
|
32
|
+
'$projectId': projectId
|
|
33
|
+
};
|
|
34
|
+
return this.beginRequest({
|
|
35
|
+
apiVersion: "7.2-preview.1",
|
|
36
|
+
method: "POST",
|
|
37
|
+
routeTemplate: "_apis/git/advsecCopilot/author",
|
|
38
|
+
queryParams: queryValues
|
|
39
|
+
});
|
|
40
|
+
});
|
|
41
|
+
}
|
|
24
42
|
/**
|
|
25
43
|
* DELETE Deletes Enablement status and BillableCommitters data from DB. Deleting the enablement data will effectively disable it for the repositories affected.
|
|
26
44
|
*
|