11import { CxManifestStatus } from './CxManifestStatus' ;
22
3+ export interface Location {
4+ line : number ;
5+ startIndex : number ;
6+ endIndex : number ;
7+ }
8+
39export default class CxOssResult {
410 packageManager : string ;
511 packageName : string ;
612 version : string ;
713 filepath : string ;
8- lineStart : number ;
9- lineEnd : number ;
10- startIndex : number ;
11- endIndex : number ;
14+ locations : Location [ ] ;
1215 status : CxManifestStatus ;
1316 vulnerabilities : { cve : string , description : string , severity : string } [ ] ;
1417
@@ -20,12 +23,15 @@ export default class CxOssResult {
2023 const ossResult = new CxOssResult ( ) ;
2124 ossResult . packageManager = member . PackageManager ;
2225 ossResult . packageName = member . PackageName ;
23- ossResult . version = member . PackageVersion ;
26+ ossResult . version = member . Version ;
2427 ossResult . filepath = member . FilePath ;
25- ossResult . lineStart = member . LineStart ;
26- ossResult . lineEnd = member . LineEnd ;
27- ossResult . startIndex = member . StartIndex ;
28- ossResult . endIndex = member . EndIndex ;
28+ ossResult . locations = Array . isArray ( member . Locations )
29+ ? member . Locations . map ( ( loc : any ) => ( {
30+ line : loc . Line ,
31+ startIndex : loc . StartIndex ,
32+ endIndex : loc . EndIndex
33+ } ) )
34+ : [ ] ;
2935 ossResult . status = member . Status as CxManifestStatus ;
3036 ossResult . vulnerabilities = Array . isArray ( member . Vulnerabilities )
3137 ? member . Vulnerabilities . map ( ( vul : any ) => ( {
@@ -40,12 +46,15 @@ export default class CxOssResult {
4046 const ossResult = new CxOssResult ( ) ;
4147 ossResult . packageManager = packages . PackageManager ;
4248 ossResult . packageName = packages . PackageName ;
43- ossResult . version = packages . PackageVersion ;
49+ ossResult . version = packages . Version ;
4450 ossResult . filepath = packages . FilePath ;
45- ossResult . lineStart = packages . LineStart ;
46- ossResult . lineEnd = packages . LineEnd ;
47- ossResult . startIndex = packages . StartIndex ;
48- ossResult . endIndex = packages . EndIndex ;
51+ ossResult . locations = Array . isArray ( packages . Locations )
52+ ? packages . Locations . map ( ( loc : any ) => ( {
53+ line : loc . Line ,
54+ startIndex : loc . StartIndex ,
55+ endIndex : loc . EndIndex
56+ } ) )
57+ : [ ] ;
4958 ossResult . status = packages . Status as CxManifestStatus ;
5059 ossResult . vulnerabilities = Array . isArray ( packages . Vulnerabilities )
5160 ? packages . Vulnerabilities . map ( ( vul : any ) => ( {
0 commit comments