azure-devops-extension-api 4.226.0 → 4.228.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 +484 -0
- package/Alert/Alert.js +135 -0
- package/Alert/Alert.min.js +1 -0
- package/Alert/AlertClient.d.ts +68 -0
- package/Alert/AlertClient.js +278 -0
- package/Alert/AlertClient.min.js +1 -0
- package/Build/Build.d.ts +4 -0
- package/FileContainer/FileContainerClient.d.ts +2 -1
- package/FileContainer/FileContainerClient.js +4 -2
- package/FileContainer/FileContainerClient.min.js +1 -1
- package/Management/Management.d.ts +71 -0
- package/Management/Management.js +24 -0
- package/Management/Management.min.js +1 -0
- package/Management/ManagementClient.d.ts +98 -0
- package/Management/ManagementClient.js +376 -0
- package/Management/ManagementClient.min.js +1 -0
- package/ServiceEndpoint/ServiceEndpoint.d.ts +4 -0
- package/TaskAgent/TaskAgent.d.ts +21 -0
- package/TaskAgent/TaskAgentClient.d.ts +8 -0
- package/TaskAgent/TaskAgentClient.js +26 -0
- package/TaskAgent/TaskAgentClient.min.js +1 -1
- package/Test/Test.d.ts +25 -1
- package/Test/Test.js +4 -0
- package/Test/Test.min.js +1 -1
- package/TestResults/TestResultsClient.d.ts +5 -0
- package/TestResults/TestResultsClient.js +22 -0
- package/TestResults/TestResultsClient.min.js +1 -1
- package/Work/Work.d.ts +6 -0
- package/Work/WorkClient.d.ts +7 -0
- package/Work/WorkClient.js +25 -0
- package/Work/WorkClient.min.js +1 -1
- package/package.json +1 -1
package/Alert/Alert.d.ts
ADDED
|
@@ -0,0 +1,484 @@
|
|
|
1
|
+
import * as WebApi from "../WebApi/WebApi";
|
|
2
|
+
export interface Alert {
|
|
3
|
+
/**
|
|
4
|
+
* Identifier for the alert. It is unqiue within Azure DevOps organization.
|
|
5
|
+
*/
|
|
6
|
+
alertId: number;
|
|
7
|
+
/**
|
|
8
|
+
* Type of the alert. E.g. secret, code, etc.
|
|
9
|
+
*/
|
|
10
|
+
alertType: AlertType;
|
|
11
|
+
/**
|
|
12
|
+
* Contains information for the dismissal of the alert if the alert has been dismissed.
|
|
13
|
+
*/
|
|
14
|
+
dismissal: Dismissal;
|
|
15
|
+
/**
|
|
16
|
+
* This value is computed and returned by the service. This value represents the first time the service has seen this issue reported in an analysis instance.
|
|
17
|
+
*/
|
|
18
|
+
firstSeenDate: Date;
|
|
19
|
+
/**
|
|
20
|
+
* This value is computed and returned by the service. If the issue is fixed, this value represents the time the service has seen this issue fixed in an analysis instance.
|
|
21
|
+
*/
|
|
22
|
+
fixedDate: Date;
|
|
23
|
+
/**
|
|
24
|
+
* Reference to a git object, e.g. branch ref.
|
|
25
|
+
*/
|
|
26
|
+
gitRef: string;
|
|
27
|
+
/**
|
|
28
|
+
* This value is computed and returned by the service. This value represents the first time the vulnerability was introduced.
|
|
29
|
+
*/
|
|
30
|
+
introducedDate: Date;
|
|
31
|
+
/**
|
|
32
|
+
* 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.
|
|
33
|
+
*/
|
|
34
|
+
lastSeenDate: Date;
|
|
35
|
+
/**
|
|
36
|
+
* Logical locations for the alert. This value is computed and returned by the service. It is a value based on the results from all analysis configurations. An example of a logical location is a component.
|
|
37
|
+
*/
|
|
38
|
+
logicalLocations: LogicalLocation[];
|
|
39
|
+
/**
|
|
40
|
+
* This value is computed and returned by the service. It is a value based on the results from all analysis configurations. An example of a physical location is a file location.
|
|
41
|
+
*/
|
|
42
|
+
physicalLocations: PhysicalLocation[];
|
|
43
|
+
/**
|
|
44
|
+
* Repository URL where the alert was detected.
|
|
45
|
+
*/
|
|
46
|
+
repositoryUrl: string;
|
|
47
|
+
/**
|
|
48
|
+
* Severity of the alert.
|
|
49
|
+
*/
|
|
50
|
+
severity: Severity;
|
|
51
|
+
/**
|
|
52
|
+
* This value is computed and returned by the service. It is a value based on the results from all analysis configurations.
|
|
53
|
+
*/
|
|
54
|
+
state: State;
|
|
55
|
+
/**
|
|
56
|
+
* Title will only be rendered as text and does not support markdown formatting. There is a maximum character limit of 256.
|
|
57
|
+
*/
|
|
58
|
+
title: string;
|
|
59
|
+
/**
|
|
60
|
+
* Tools that have detected this issue.
|
|
61
|
+
*/
|
|
62
|
+
tools: Tool[];
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Summary of the state of the alert for a given analysis configuration.
|
|
66
|
+
*/
|
|
67
|
+
export interface AlertAnalysisInstance {
|
|
68
|
+
/**
|
|
69
|
+
* Analysis configuration.
|
|
70
|
+
*/
|
|
71
|
+
analysisConfiguration: AnalysisConfiguration;
|
|
72
|
+
/**
|
|
73
|
+
* Analysis instance where the issue was first detected for a given analysis configuration.
|
|
74
|
+
*/
|
|
75
|
+
firstSeen: AnalysisInstance;
|
|
76
|
+
/**
|
|
77
|
+
* Analysis instance where the issue was fixed for a given analysis configuration.
|
|
78
|
+
*/
|
|
79
|
+
fixedIn: AnalysisInstance;
|
|
80
|
+
/**
|
|
81
|
+
* Analysis instance where the issue was last detected for a given analysis configuration.
|
|
82
|
+
*/
|
|
83
|
+
lastSeen: AnalysisInstance;
|
|
84
|
+
/**
|
|
85
|
+
* The most recent instatnce of the analysis.
|
|
86
|
+
*/
|
|
87
|
+
recentAnalysisInstance: AnalysisInstance;
|
|
88
|
+
/**
|
|
89
|
+
* Result state for a given analysis configuration.
|
|
90
|
+
*/
|
|
91
|
+
state: State;
|
|
92
|
+
}
|
|
93
|
+
export interface AlertStateUpdate {
|
|
94
|
+
dismissedComment: string;
|
|
95
|
+
dismissedReason: DismissalType;
|
|
96
|
+
state: State;
|
|
97
|
+
}
|
|
98
|
+
export declare enum AlertType {
|
|
99
|
+
Unknown = 0,
|
|
100
|
+
Dependency = 1,
|
|
101
|
+
Secret = 2,
|
|
102
|
+
Code = 3
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* AnalysisConfiguration class models a build definition.
|
|
106
|
+
*/
|
|
107
|
+
export interface AnalysisConfiguration {
|
|
108
|
+
/**
|
|
109
|
+
* Details for the configuration. Populated values depend on the type of configuration.
|
|
110
|
+
*/
|
|
111
|
+
analysisConfigurationDetails: AnalysisConfigurationDetails;
|
|
112
|
+
/**
|
|
113
|
+
* Identifier for the analysis configuration.
|
|
114
|
+
*/
|
|
115
|
+
analysisConfigurationId: number;
|
|
116
|
+
/**
|
|
117
|
+
* Type of the configuration.
|
|
118
|
+
*/
|
|
119
|
+
analysisConfigurationType: AnalysisConfigurationType;
|
|
120
|
+
/**
|
|
121
|
+
* Name of the tool that ran on this configuration.
|
|
122
|
+
*/
|
|
123
|
+
toolName: string;
|
|
124
|
+
/**
|
|
125
|
+
* The latest version of the tool that ran on this configuration.
|
|
126
|
+
*/
|
|
127
|
+
toolVersion: string;
|
|
128
|
+
}
|
|
129
|
+
export interface AnalysisConfigurationDetails {
|
|
130
|
+
/**
|
|
131
|
+
* Reference to a git object, e.g. branch ref.
|
|
132
|
+
*/
|
|
133
|
+
gitRef: string;
|
|
134
|
+
/**
|
|
135
|
+
* Is this the default branch?
|
|
136
|
+
*/
|
|
137
|
+
isDefaultBranch: boolean;
|
|
138
|
+
/**
|
|
139
|
+
* Phase ID of the pipeline.
|
|
140
|
+
*/
|
|
141
|
+
phaseId: string;
|
|
142
|
+
/**
|
|
143
|
+
* Phase name.
|
|
144
|
+
*/
|
|
145
|
+
phaseName: string;
|
|
146
|
+
/**
|
|
147
|
+
* AzureDevOps pipeline id.
|
|
148
|
+
*/
|
|
149
|
+
pipelineId: number;
|
|
150
|
+
/**
|
|
151
|
+
* Name of the pipeline.
|
|
152
|
+
*/
|
|
153
|
+
pipelineName: string;
|
|
154
|
+
}
|
|
155
|
+
export declare enum AnalysisConfigurationType {
|
|
156
|
+
/**
|
|
157
|
+
* Default analysis configuration that is not attached to any other configuration data
|
|
158
|
+
*/
|
|
159
|
+
Default = 0,
|
|
160
|
+
/**
|
|
161
|
+
* Ado Pipeline, contains branch, pipeline, phase, and ADOPipelineId
|
|
162
|
+
*/
|
|
163
|
+
AdoPipeline = 1
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* AnalysisInstance class models a build.
|
|
167
|
+
*/
|
|
168
|
+
export interface AnalysisInstance {
|
|
169
|
+
/**
|
|
170
|
+
* CommitId is a commit id for that instance
|
|
171
|
+
*/
|
|
172
|
+
commitId: string;
|
|
173
|
+
/**
|
|
174
|
+
* Analysis configuration.
|
|
175
|
+
*/
|
|
176
|
+
configuration: AnalysisConfiguration;
|
|
177
|
+
/**
|
|
178
|
+
* Date when the analysis was created.
|
|
179
|
+
*/
|
|
180
|
+
createdDate: Date;
|
|
181
|
+
/**
|
|
182
|
+
* InstanceIdentifier is a key that uniquely establishes this instance
|
|
183
|
+
*/
|
|
184
|
+
instanceIdentifier: string;
|
|
185
|
+
/**
|
|
186
|
+
* Results that were reported by the analysis.
|
|
187
|
+
*/
|
|
188
|
+
results: AnalysisResult[];
|
|
189
|
+
/**
|
|
190
|
+
* Url is the permalink to the build.
|
|
191
|
+
*/
|
|
192
|
+
url: string;
|
|
193
|
+
}
|
|
194
|
+
export interface AnalysisResult {
|
|
195
|
+
analysisResultId: number;
|
|
196
|
+
firstIntroducedInstanceId: number;
|
|
197
|
+
fixedInstanceId: number;
|
|
198
|
+
introducedInstanceId: number;
|
|
199
|
+
lastSeenInstanceId: number;
|
|
200
|
+
result: Result;
|
|
201
|
+
state: State;
|
|
202
|
+
}
|
|
203
|
+
export interface Branch {
|
|
204
|
+
branchId: number;
|
|
205
|
+
deletedDate: Date;
|
|
206
|
+
name: string;
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* This enum defines the dependency components.
|
|
210
|
+
*/
|
|
211
|
+
export declare enum ComponentType {
|
|
212
|
+
Unknown = 0,
|
|
213
|
+
NuGet = 1,
|
|
214
|
+
/**
|
|
215
|
+
* Indicates the component is an Npm package.
|
|
216
|
+
*/
|
|
217
|
+
Npm = 2,
|
|
218
|
+
/**
|
|
219
|
+
* Indicates the component is a Maven artifact.
|
|
220
|
+
*/
|
|
221
|
+
Maven = 3,
|
|
222
|
+
/**
|
|
223
|
+
* Indicates the component is a Git repository.
|
|
224
|
+
*/
|
|
225
|
+
Git = 4,
|
|
226
|
+
/**
|
|
227
|
+
* Indicates the component is not any of the supported component types by Governance.
|
|
228
|
+
*/
|
|
229
|
+
Other = 5,
|
|
230
|
+
/**
|
|
231
|
+
* Indicates the component is a Ruby gem.
|
|
232
|
+
*/
|
|
233
|
+
RubyGems = 6,
|
|
234
|
+
/**
|
|
235
|
+
* Indicates the component is a Cargo package.
|
|
236
|
+
*/
|
|
237
|
+
Cargo = 7,
|
|
238
|
+
/**
|
|
239
|
+
* Indicates the component is a Pip package.
|
|
240
|
+
*/
|
|
241
|
+
Pip = 8,
|
|
242
|
+
/**
|
|
243
|
+
* Indicates the component is a loose file. Not a package as understood by different package managers.
|
|
244
|
+
*/
|
|
245
|
+
File = 9,
|
|
246
|
+
Go = 10,
|
|
247
|
+
/**
|
|
248
|
+
* Indicates the component is a Docker Image
|
|
249
|
+
*/
|
|
250
|
+
DockerImage = 11,
|
|
251
|
+
/**
|
|
252
|
+
* Indicates the component is a CocoaPods pod.
|
|
253
|
+
*/
|
|
254
|
+
Pod = 12,
|
|
255
|
+
/**
|
|
256
|
+
* Indicates the component is found in a linux environment. A package understood by linux based package managers like apt and rpm.
|
|
257
|
+
*/
|
|
258
|
+
Linux = 13,
|
|
259
|
+
/**
|
|
260
|
+
* Indicates the component is a Conda package.
|
|
261
|
+
*/
|
|
262
|
+
Conda = 14,
|
|
263
|
+
/**
|
|
264
|
+
* Indicates the component is a Docker Reference.
|
|
265
|
+
*/
|
|
266
|
+
DockerReference = 15,
|
|
267
|
+
/**
|
|
268
|
+
* Indicates the component is a Vcpkg Package.
|
|
269
|
+
*/
|
|
270
|
+
Vcpkg = 16
|
|
271
|
+
}
|
|
272
|
+
export interface Dependency {
|
|
273
|
+
componentName: string;
|
|
274
|
+
componentType: ComponentType;
|
|
275
|
+
componentVersion: string;
|
|
276
|
+
dependencyId: number;
|
|
277
|
+
}
|
|
278
|
+
export interface DependencyResult {
|
|
279
|
+
dependency: Dependency;
|
|
280
|
+
dependencyResultId: number;
|
|
281
|
+
resultId: number;
|
|
282
|
+
rootDependencyId: number;
|
|
283
|
+
versionControlFilePath: VersionControlFilePath;
|
|
284
|
+
}
|
|
285
|
+
export interface Dismissal {
|
|
286
|
+
dismissalId: number;
|
|
287
|
+
dismissalType: DismissalType;
|
|
288
|
+
message: string;
|
|
289
|
+
requestedOn: Date;
|
|
290
|
+
stateChangedBy: string;
|
|
291
|
+
stateChangedByIdentity: WebApi.IdentityRef;
|
|
292
|
+
}
|
|
293
|
+
export declare enum DismissalType {
|
|
294
|
+
/**
|
|
295
|
+
* Dismissal type unknown
|
|
296
|
+
*/
|
|
297
|
+
Unknown = 0,
|
|
298
|
+
/**
|
|
299
|
+
* Dismissal indicating alert has been fixed
|
|
300
|
+
*/
|
|
301
|
+
Fixed = 1,
|
|
302
|
+
/**
|
|
303
|
+
* Dismissal indicating user is accepting a risk for the alert
|
|
304
|
+
*/
|
|
305
|
+
AcceptedRisk = 2,
|
|
306
|
+
/**
|
|
307
|
+
* Dismissal indicating alert is a false positive and will likely not be fixed.
|
|
308
|
+
*/
|
|
309
|
+
FalsePositive = 3
|
|
310
|
+
}
|
|
311
|
+
export interface LogicalLocation {
|
|
312
|
+
fullyQualifiedName: string;
|
|
313
|
+
/**
|
|
314
|
+
* Possible values: "unknown" "rootDependency" and "vulnerableDependency"
|
|
315
|
+
*/
|
|
316
|
+
kind: string;
|
|
317
|
+
}
|
|
318
|
+
export interface PhysicalLocation {
|
|
319
|
+
filePath: string;
|
|
320
|
+
region: Region;
|
|
321
|
+
versionControl: VersionControlDetails;
|
|
322
|
+
}
|
|
323
|
+
export interface Pipeline {
|
|
324
|
+
adoPipelineId: number;
|
|
325
|
+
name: string;
|
|
326
|
+
phase: string;
|
|
327
|
+
phaseId: string;
|
|
328
|
+
}
|
|
329
|
+
export interface Region {
|
|
330
|
+
columnEnd: number;
|
|
331
|
+
columnStart: number;
|
|
332
|
+
highlightSnippet: string;
|
|
333
|
+
lineEnd: number;
|
|
334
|
+
lineStart: number;
|
|
335
|
+
snippet: string;
|
|
336
|
+
}
|
|
337
|
+
export interface Result {
|
|
338
|
+
dependencyResult: DependencyResult;
|
|
339
|
+
fingerprint: string;
|
|
340
|
+
fingerprintId: number;
|
|
341
|
+
resultId: number;
|
|
342
|
+
/**
|
|
343
|
+
* This is the index into the SARIF Results array. If we have to do any tool specific insertions, we'll use this key to index back into the SARIF Results array.
|
|
344
|
+
*/
|
|
345
|
+
resultIndex: number;
|
|
346
|
+
resultMessage: string;
|
|
347
|
+
resultType: ResultType;
|
|
348
|
+
ruleId: number;
|
|
349
|
+
ruleShortDescription: string;
|
|
350
|
+
severity: Severity;
|
|
351
|
+
versionControlResult: VersionControlResult;
|
|
352
|
+
}
|
|
353
|
+
/**
|
|
354
|
+
* This enum defines the different result types.
|
|
355
|
+
*/
|
|
356
|
+
export declare enum ResultType {
|
|
357
|
+
Unknown = 0,
|
|
358
|
+
Dependency = 1,
|
|
359
|
+
VersionControl = 2
|
|
360
|
+
}
|
|
361
|
+
/**
|
|
362
|
+
* The analysis rule that caused the alert.
|
|
363
|
+
*/
|
|
364
|
+
export interface Rule {
|
|
365
|
+
description: string;
|
|
366
|
+
friendlyName: string;
|
|
367
|
+
helpMessage: string;
|
|
368
|
+
opaqueId: string;
|
|
369
|
+
/**
|
|
370
|
+
* Markdown-formatted list of resources to learn more about the Rule. In some cases, RuleInfo.AdditionalProperties.advisoryUrls is used instead.
|
|
371
|
+
*/
|
|
372
|
+
resources: string;
|
|
373
|
+
tags: string[];
|
|
374
|
+
}
|
|
375
|
+
export interface SearchCriteria {
|
|
376
|
+
/**
|
|
377
|
+
* If provided, only return alerts of this type. Otherwise, return alerts of all types.
|
|
378
|
+
*/
|
|
379
|
+
alertType: AlertType;
|
|
380
|
+
/**
|
|
381
|
+
* If provided, only alerts for this dependency are returned. \<br /\>Otherwise, return alerts for all dependencies. \<br /\>In a sarif submission, a dependency (or a vulnerable component) is specified in result.RelatedLocations[].logicalLocation.
|
|
382
|
+
*/
|
|
383
|
+
dependencyName: string;
|
|
384
|
+
/**
|
|
385
|
+
* If provided, only return alerts last seen after this date. \<br /\>Otherwise return all alerts.
|
|
386
|
+
*/
|
|
387
|
+
fromDate: Date;
|
|
388
|
+
/**
|
|
389
|
+
* If provided, only return alerts whose titles match this pattern.
|
|
390
|
+
*/
|
|
391
|
+
keywords: string;
|
|
392
|
+
/**
|
|
393
|
+
* If true, only return alerts found on the default branch of the repository. \<br /\>If there have been no runs completed on the default branch, the last run is used instead regardless of the branch used for that run. \<br /\>This option is ignored if branchName or ref are provided.
|
|
394
|
+
*/
|
|
395
|
+
onlyDefaultBranchAlerts: boolean;
|
|
396
|
+
/**
|
|
397
|
+
* If provided with pipelineName, only return alerts detected in this pipeline phase \<br /\>Otherwise, return alerts detected in all phases.
|
|
398
|
+
*/
|
|
399
|
+
phaseId: string;
|
|
400
|
+
/**
|
|
401
|
+
* If provided with pipelineName, only return alerts detected in this pipeline phase \<br /\>Otherwise, return alerts detected in all phases.
|
|
402
|
+
*/
|
|
403
|
+
phaseName: string;
|
|
404
|
+
/**
|
|
405
|
+
* If provided, only return alerts detected in this pipeline. \<br /\>Otherwise, return alerts detected in all pipelines.
|
|
406
|
+
*/
|
|
407
|
+
pipelineName: string;
|
|
408
|
+
/**
|
|
409
|
+
* If provided, only include alerts for this ref. \<br /\>If not provided and OnlyDefaultBranch is true, only include alerts found on the default branch or last run branch if there is no analysis configuration for the default branch. \<br /\>Otherwise, include alerts from all branches.
|
|
410
|
+
*/
|
|
411
|
+
ref: string;
|
|
412
|
+
/**
|
|
413
|
+
* If provided, only return alerts for this rule. \<br /\>Otherwise, return alerts of all rules.
|
|
414
|
+
*/
|
|
415
|
+
ruleId: string;
|
|
416
|
+
/**
|
|
417
|
+
* If provided, only return alerts for this rule. \<br /\>Otherwise, return alerts for all rules.
|
|
418
|
+
*/
|
|
419
|
+
ruleName: string;
|
|
420
|
+
/**
|
|
421
|
+
* If provided, only return alerts at these severities. \<br /\>Otherwise, return alerts at any serverity.
|
|
422
|
+
*/
|
|
423
|
+
severities: Severity[];
|
|
424
|
+
/**
|
|
425
|
+
* If provided, only return alerts in these states. \<br /\>Otherwise, return alerts in any state.
|
|
426
|
+
*/
|
|
427
|
+
states: State[];
|
|
428
|
+
/**
|
|
429
|
+
* If provided, only return alerts last seen before this date. \<br /\>Otherwise return all alerts.
|
|
430
|
+
*/
|
|
431
|
+
toDate: Date;
|
|
432
|
+
}
|
|
433
|
+
export declare enum Severity {
|
|
434
|
+
Low = 0,
|
|
435
|
+
Medium = 1,
|
|
436
|
+
High = 2,
|
|
437
|
+
Critical = 3
|
|
438
|
+
}
|
|
439
|
+
export declare enum State {
|
|
440
|
+
Unknown = 0,
|
|
441
|
+
Active = 1,
|
|
442
|
+
Dismissed = 2,
|
|
443
|
+
Fixed = 4,
|
|
444
|
+
AutoDismissed = 8
|
|
445
|
+
}
|
|
446
|
+
export interface Tool {
|
|
447
|
+
name: string;
|
|
448
|
+
rules: Rule[];
|
|
449
|
+
}
|
|
450
|
+
export interface UxFilters {
|
|
451
|
+
branches: Branch[];
|
|
452
|
+
packages: Dependency[];
|
|
453
|
+
pipelines: Pipeline[];
|
|
454
|
+
progressPercentage: number;
|
|
455
|
+
rules: Rule[];
|
|
456
|
+
secretTypes: string[];
|
|
457
|
+
severities: Severity[];
|
|
458
|
+
states: State[];
|
|
459
|
+
}
|
|
460
|
+
export interface VersionControlDetails {
|
|
461
|
+
commitHash: string;
|
|
462
|
+
itemUrl: string;
|
|
463
|
+
}
|
|
464
|
+
export interface VersionControlFilePath {
|
|
465
|
+
filePath: string;
|
|
466
|
+
filePathHash: number[];
|
|
467
|
+
versionControlFilePathId: number;
|
|
468
|
+
}
|
|
469
|
+
export interface VersionControlResult {
|
|
470
|
+
resultId: number;
|
|
471
|
+
versionControlSnippet: VersionControlSnippet;
|
|
472
|
+
}
|
|
473
|
+
export interface VersionControlSnippet {
|
|
474
|
+
endColumn: number;
|
|
475
|
+
endLine: number;
|
|
476
|
+
highlightSnippet: string;
|
|
477
|
+
snippet: string;
|
|
478
|
+
startColumn: number;
|
|
479
|
+
startLine: number;
|
|
480
|
+
versionControl: string;
|
|
481
|
+
versionControlFilePath: VersionControlFilePath;
|
|
482
|
+
versionControlFilePathId: number;
|
|
483
|
+
versionControlSnippetId: number;
|
|
484
|
+
}
|
package/Alert/Alert.js
ADDED
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* ---------------------------------------------------------
|
|
3
|
+
* Copyright(C) Microsoft Corporation. All rights reserved.
|
|
4
|
+
* ---------------------------------------------------------
|
|
5
|
+
*/
|
|
6
|
+
define(["require", "exports"], function (require, exports) {
|
|
7
|
+
"use strict";
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
var AlertType;
|
|
10
|
+
(function (AlertType) {
|
|
11
|
+
AlertType[AlertType["Unknown"] = 0] = "Unknown";
|
|
12
|
+
AlertType[AlertType["Dependency"] = 1] = "Dependency";
|
|
13
|
+
AlertType[AlertType["Secret"] = 2] = "Secret";
|
|
14
|
+
AlertType[AlertType["Code"] = 3] = "Code";
|
|
15
|
+
})(AlertType = exports.AlertType || (exports.AlertType = {}));
|
|
16
|
+
var AnalysisConfigurationType;
|
|
17
|
+
(function (AnalysisConfigurationType) {
|
|
18
|
+
/**
|
|
19
|
+
* Default analysis configuration that is not attached to any other configuration data
|
|
20
|
+
*/
|
|
21
|
+
AnalysisConfigurationType[AnalysisConfigurationType["Default"] = 0] = "Default";
|
|
22
|
+
/**
|
|
23
|
+
* Ado Pipeline, contains branch, pipeline, phase, and ADOPipelineId
|
|
24
|
+
*/
|
|
25
|
+
AnalysisConfigurationType[AnalysisConfigurationType["AdoPipeline"] = 1] = "AdoPipeline";
|
|
26
|
+
})(AnalysisConfigurationType = exports.AnalysisConfigurationType || (exports.AnalysisConfigurationType = {}));
|
|
27
|
+
/**
|
|
28
|
+
* This enum defines the dependency components.
|
|
29
|
+
*/
|
|
30
|
+
var ComponentType;
|
|
31
|
+
(function (ComponentType) {
|
|
32
|
+
ComponentType[ComponentType["Unknown"] = 0] = "Unknown";
|
|
33
|
+
ComponentType[ComponentType["NuGet"] = 1] = "NuGet";
|
|
34
|
+
/**
|
|
35
|
+
* Indicates the component is an Npm package.
|
|
36
|
+
*/
|
|
37
|
+
ComponentType[ComponentType["Npm"] = 2] = "Npm";
|
|
38
|
+
/**
|
|
39
|
+
* Indicates the component is a Maven artifact.
|
|
40
|
+
*/
|
|
41
|
+
ComponentType[ComponentType["Maven"] = 3] = "Maven";
|
|
42
|
+
/**
|
|
43
|
+
* Indicates the component is a Git repository.
|
|
44
|
+
*/
|
|
45
|
+
ComponentType[ComponentType["Git"] = 4] = "Git";
|
|
46
|
+
/**
|
|
47
|
+
* Indicates the component is not any of the supported component types by Governance.
|
|
48
|
+
*/
|
|
49
|
+
ComponentType[ComponentType["Other"] = 5] = "Other";
|
|
50
|
+
/**
|
|
51
|
+
* Indicates the component is a Ruby gem.
|
|
52
|
+
*/
|
|
53
|
+
ComponentType[ComponentType["RubyGems"] = 6] = "RubyGems";
|
|
54
|
+
/**
|
|
55
|
+
* Indicates the component is a Cargo package.
|
|
56
|
+
*/
|
|
57
|
+
ComponentType[ComponentType["Cargo"] = 7] = "Cargo";
|
|
58
|
+
/**
|
|
59
|
+
* Indicates the component is a Pip package.
|
|
60
|
+
*/
|
|
61
|
+
ComponentType[ComponentType["Pip"] = 8] = "Pip";
|
|
62
|
+
/**
|
|
63
|
+
* Indicates the component is a loose file. Not a package as understood by different package managers.
|
|
64
|
+
*/
|
|
65
|
+
ComponentType[ComponentType["File"] = 9] = "File";
|
|
66
|
+
ComponentType[ComponentType["Go"] = 10] = "Go";
|
|
67
|
+
/**
|
|
68
|
+
* Indicates the component is a Docker Image
|
|
69
|
+
*/
|
|
70
|
+
ComponentType[ComponentType["DockerImage"] = 11] = "DockerImage";
|
|
71
|
+
/**
|
|
72
|
+
* Indicates the component is a CocoaPods pod.
|
|
73
|
+
*/
|
|
74
|
+
ComponentType[ComponentType["Pod"] = 12] = "Pod";
|
|
75
|
+
/**
|
|
76
|
+
* Indicates the component is found in a linux environment. A package understood by linux based package managers like apt and rpm.
|
|
77
|
+
*/
|
|
78
|
+
ComponentType[ComponentType["Linux"] = 13] = "Linux";
|
|
79
|
+
/**
|
|
80
|
+
* Indicates the component is a Conda package.
|
|
81
|
+
*/
|
|
82
|
+
ComponentType[ComponentType["Conda"] = 14] = "Conda";
|
|
83
|
+
/**
|
|
84
|
+
* Indicates the component is a Docker Reference.
|
|
85
|
+
*/
|
|
86
|
+
ComponentType[ComponentType["DockerReference"] = 15] = "DockerReference";
|
|
87
|
+
/**
|
|
88
|
+
* Indicates the component is a Vcpkg Package.
|
|
89
|
+
*/
|
|
90
|
+
ComponentType[ComponentType["Vcpkg"] = 16] = "Vcpkg";
|
|
91
|
+
})(ComponentType = exports.ComponentType || (exports.ComponentType = {}));
|
|
92
|
+
var DismissalType;
|
|
93
|
+
(function (DismissalType) {
|
|
94
|
+
/**
|
|
95
|
+
* Dismissal type unknown
|
|
96
|
+
*/
|
|
97
|
+
DismissalType[DismissalType["Unknown"] = 0] = "Unknown";
|
|
98
|
+
/**
|
|
99
|
+
* Dismissal indicating alert has been fixed
|
|
100
|
+
*/
|
|
101
|
+
DismissalType[DismissalType["Fixed"] = 1] = "Fixed";
|
|
102
|
+
/**
|
|
103
|
+
* Dismissal indicating user is accepting a risk for the alert
|
|
104
|
+
*/
|
|
105
|
+
DismissalType[DismissalType["AcceptedRisk"] = 2] = "AcceptedRisk";
|
|
106
|
+
/**
|
|
107
|
+
* Dismissal indicating alert is a false positive and will likely not be fixed.
|
|
108
|
+
*/
|
|
109
|
+
DismissalType[DismissalType["FalsePositive"] = 3] = "FalsePositive";
|
|
110
|
+
})(DismissalType = exports.DismissalType || (exports.DismissalType = {}));
|
|
111
|
+
/**
|
|
112
|
+
* This enum defines the different result types.
|
|
113
|
+
*/
|
|
114
|
+
var ResultType;
|
|
115
|
+
(function (ResultType) {
|
|
116
|
+
ResultType[ResultType["Unknown"] = 0] = "Unknown";
|
|
117
|
+
ResultType[ResultType["Dependency"] = 1] = "Dependency";
|
|
118
|
+
ResultType[ResultType["VersionControl"] = 2] = "VersionControl";
|
|
119
|
+
})(ResultType = exports.ResultType || (exports.ResultType = {}));
|
|
120
|
+
var Severity;
|
|
121
|
+
(function (Severity) {
|
|
122
|
+
Severity[Severity["Low"] = 0] = "Low";
|
|
123
|
+
Severity[Severity["Medium"] = 1] = "Medium";
|
|
124
|
+
Severity[Severity["High"] = 2] = "High";
|
|
125
|
+
Severity[Severity["Critical"] = 3] = "Critical";
|
|
126
|
+
})(Severity = exports.Severity || (exports.Severity = {}));
|
|
127
|
+
var State;
|
|
128
|
+
(function (State) {
|
|
129
|
+
State[State["Unknown"] = 0] = "Unknown";
|
|
130
|
+
State[State["Active"] = 1] = "Active";
|
|
131
|
+
State[State["Dismissed"] = 2] = "Dismissed";
|
|
132
|
+
State[State["Fixed"] = 4] = "Fixed";
|
|
133
|
+
State[State["AutoDismissed"] = 8] = "AutoDismissed";
|
|
134
|
+
})(State = exports.State || (exports.State = {}));
|
|
135
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
define(["require","exports"],function(e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});!function(e){e[e.Unknown=0]="Unknown",e[e.Dependency=1]="Dependency",e[e.Secret=2]="Secret",e[e.Code=3]="Code"}(n.AlertType||(n.AlertType={}));!function(e){e[e.Default=0]="Default",e[e.AdoPipeline=1]="AdoPipeline"}(n.AnalysisConfigurationType||(n.AnalysisConfigurationType={}));!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"}(n.ComponentType||(n.ComponentType={}));!function(e){e[e.Unknown=0]="Unknown",e[e.Fixed=1]="Fixed",e[e.AcceptedRisk=2]="AcceptedRisk",e[e.FalsePositive=3]="FalsePositive"}(n.DismissalType||(n.DismissalType={}));!function(e){e[e.Unknown=0]="Unknown",e[e.Dependency=1]="Dependency",e[e.VersionControl=2]="VersionControl"}(n.ResultType||(n.ResultType={}));!function(e){e[e.Low=0]="Low",e[e.Medium=1]="Medium",e[e.High=2]="High",e[e.Critical=3]="Critical"}(n.Severity||(n.Severity={}));!function(e){e[e.Unknown=0]="Unknown",e[e.Active=1]="Active",e[e.Dismissed=2]="Dismissed",e[e.Fixed=4]="Fixed",e[e.AutoDismissed=8]="AutoDismissed"}(n.State||(n.State={}))});
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { IVssRestClientOptions } from "../Common/Context";
|
|
2
|
+
import { RestClientBase } from "../Common/RestClientBase";
|
|
3
|
+
import * as Alert from "../Alert/Alert";
|
|
4
|
+
import * as WebApi from "../WebApi/WebApi";
|
|
5
|
+
export declare class AlertRestClient extends RestClientBase {
|
|
6
|
+
constructor(options: IVssRestClientOptions);
|
|
7
|
+
/**
|
|
8
|
+
* @param project - Project ID or project name
|
|
9
|
+
* @param alertId -
|
|
10
|
+
* @param repository -
|
|
11
|
+
* @param ref -
|
|
12
|
+
*/
|
|
13
|
+
getAlert(project: string, alertId: number, repository: string, ref?: string): Promise<Alert.Alert>;
|
|
14
|
+
/**
|
|
15
|
+
* Get alerts for a repository
|
|
16
|
+
*
|
|
17
|
+
* @param project - Project ID or project name
|
|
18
|
+
* @param repository - The name or ID of the repository
|
|
19
|
+
* @param top - The maximum number of alerts to return
|
|
20
|
+
* @param orderBy - Must be "id" "firstSeen" "lastSeen" "fixedOn" or "severity" Defaults to "id"
|
|
21
|
+
* @param criteria - Options to limit the alerts returned
|
|
22
|
+
* @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
|
|
23
|
+
*/
|
|
24
|
+
getAlerts(project: string, repository: string, top?: number, orderBy?: string, criteria?: Alert.SearchCriteria, continuationToken?: string): Promise<WebApi.PagedList<Alert.Alert>>;
|
|
25
|
+
/**
|
|
26
|
+
* @param project - Project ID or project name
|
|
27
|
+
* @param alertId -
|
|
28
|
+
* @param repository -
|
|
29
|
+
* @param ref -
|
|
30
|
+
*/
|
|
31
|
+
getAlertSarif(project: string, alertId: number, repository: string, ref?: string): Promise<string>;
|
|
32
|
+
/**
|
|
33
|
+
* Update the status of an alert
|
|
34
|
+
*
|
|
35
|
+
* @param stateUpdate - The new status of the alert
|
|
36
|
+
* @param project - Project ID or project name
|
|
37
|
+
* @param alertId - The ID of the alert
|
|
38
|
+
* @param repository - The name or ID of the repository
|
|
39
|
+
*/
|
|
40
|
+
updateAlert(stateUpdate: Alert.AlertStateUpdate, project: string, alertId: number, repository: string): Promise<Alert.Alert>;
|
|
41
|
+
/**
|
|
42
|
+
* @param project - Project ID or project name
|
|
43
|
+
* @param alertId -
|
|
44
|
+
* @param repository -
|
|
45
|
+
* @param ref -
|
|
46
|
+
*/
|
|
47
|
+
getAlertInstances(project: string, alertId: number, repository: string, ref?: string): Promise<Alert.AlertAnalysisInstance[]>;
|
|
48
|
+
/**
|
|
49
|
+
* Upload a Sarif containing security alerts
|
|
50
|
+
*
|
|
51
|
+
* @param content - Content to upload
|
|
52
|
+
* @param project - Project ID or project name
|
|
53
|
+
* @param repository - The name or ID of a repository
|
|
54
|
+
*/
|
|
55
|
+
uploadSarif(content: string, project: string, repository: string): Promise<number>;
|
|
56
|
+
/**
|
|
57
|
+
* @param project - Project ID or project name
|
|
58
|
+
* @param repository -
|
|
59
|
+
* @param alertType -
|
|
60
|
+
*/
|
|
61
|
+
getUxFilters(project: string, repository: string, alertType: Alert.AlertType): Promise<Alert.UxFilters>;
|
|
62
|
+
/**
|
|
63
|
+
* Get the status of the Sarif processing job
|
|
64
|
+
*
|
|
65
|
+
* @param sarifId - Sarif ID returned when the Sarif was uploaded
|
|
66
|
+
*/
|
|
67
|
+
getSarif(sarifId: number): Promise<boolean>;
|
|
68
|
+
}
|