@@ -20,7 +20,7 @@ Copyright (c) OWASP Foundation. All Rights Reserved.
20
20
import type { PackageURL } from 'packageurl-js'
21
21
22
22
import type { Comparable } from '../_helpers/sortable'
23
- import { SortableComparables } from '../_helpers/sortable'
23
+ import { SortableComparables , SortableStringables } from '../_helpers/sortable'
24
24
import { treeIteratorSymbol } from '../_helpers/tree'
25
25
import type { ComponentScope , ComponentType } from '../enums'
26
26
import type { CPE } from '../types'
@@ -52,6 +52,7 @@ export interface OptionalComponentProperties {
52
52
components ?: Component [ 'components' ]
53
53
cpe ?: Component [ 'cpe' ]
54
54
properties ?: Component [ 'properties' ]
55
+ evidence ?: Component [ 'evidence' ]
55
56
}
56
57
57
58
export class Component implements Comparable < Component > {
@@ -73,6 +74,7 @@ export class Component implements Comparable<Component> {
73
74
dependencies : BomRefRepository
74
75
components : ComponentRepository
75
76
properties : PropertyRepository
77
+ evidence ?: ComponentEvidence
76
78
77
79
/** @see {@link bomRef } */
78
80
readonly #bomRef: BomRef
@@ -104,6 +106,7 @@ export class Component implements Comparable<Component> {
104
106
this . components = op . components ?? new ComponentRepository ( )
105
107
this . cpe = op . cpe
106
108
this . properties = op . properties ?? new PropertyRepository ( )
109
+ this . evidence = op . evidence
107
110
}
108
111
109
112
get bomRef ( ) : BomRef {
@@ -152,3 +155,20 @@ export class ComponentRepository extends SortableComparables<Component> {
152
155
}
153
156
}
154
157
}
158
+
159
+
160
+ export interface OptionalComponentEvidenceProperties {
161
+ licenses ?: ComponentEvidence [ 'licenses' ]
162
+ copyright ?: ComponentEvidence [ 'copyright' ]
163
+ }
164
+
165
+ export class ComponentEvidence {
166
+ licenses : LicenseRepository
167
+ copyright : SortableStringables
168
+
169
+ constructor ( op : OptionalComponentEvidenceProperties = { } ) {
170
+ this . licenses = op . licenses ?? new LicenseRepository ( )
171
+ this . copyright = op . copyright ?? new SortableStringables ( )
172
+ }
173
+ }
174
+
0 commit comments