@cyclonedx/cyclonedx-library 1.0.0-beta.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.
Files changed (169) hide show
  1. package/LICENSE +201 -0
  2. package/NOTICE +5 -0
  3. package/README.md +152 -0
  4. package/dist.node/_index.node.js +53 -0
  5. package/dist.node/_index.node.js.map +1 -0
  6. package/dist.node/enums/attachmentEncoding.js +26 -0
  7. package/dist.node/enums/attachmentEncoding.js.map +1 -0
  8. package/dist.node/enums/componentScope.js +28 -0
  9. package/dist.node/enums/componentScope.js.map +1 -0
  10. package/dist.node/enums/componentType.js +33 -0
  11. package/dist.node/enums/componentType.js.map +1 -0
  12. package/dist.node/enums/externalReferenceType.js +41 -0
  13. package/dist.node/enums/externalReferenceType.js.map +1 -0
  14. package/dist.node/enums/hashAlogorithm.js +37 -0
  15. package/dist.node/enums/hashAlogorithm.js.map +1 -0
  16. package/dist.node/enums/index.js +40 -0
  17. package/dist.node/enums/index.js.map +1 -0
  18. package/dist.node/factories/index.js +36 -0
  19. package/dist.node/factories/index.js.map +1 -0
  20. package/dist.node/factories/licenseFactory.js +56 -0
  21. package/dist.node/factories/licenseFactory.js.map +1 -0
  22. package/dist.node/helpers/types.js +26 -0
  23. package/dist.node/helpers/types.js.map +1 -0
  24. package/dist.node/models/attachment.js +30 -0
  25. package/dist.node/models/attachment.js.map +1 -0
  26. package/dist.node/models/bom.js +67 -0
  27. package/dist.node/models/bom.js.map +1 -0
  28. package/dist.node/models/bomRef.js +37 -0
  29. package/dist.node/models/bomRef.js.map +1 -0
  30. package/dist.node/models/component.js +96 -0
  31. package/dist.node/models/component.js.map +1 -0
  32. package/dist.node/models/externalReference.js +40 -0
  33. package/dist.node/models/externalReference.js.map +1 -0
  34. package/dist.node/models/hash.js +29 -0
  35. package/dist.node/models/hash.js.map +1 -0
  36. package/dist.node/models/index.js +47 -0
  37. package/dist.node/models/index.js.map +1 -0
  38. package/dist.node/models/license.js +103 -0
  39. package/dist.node/models/license.js.map +1 -0
  40. package/dist.node/models/metadata.js +35 -0
  41. package/dist.node/models/metadata.js.map +1 -0
  42. package/dist.node/models/organizationalContact.js +41 -0
  43. package/dist.node/models/organizationalContact.js.map +1 -0
  44. package/dist.node/models/organizationalEntity.js +31 -0
  45. package/dist.node/models/organizationalEntity.js.map +1 -0
  46. package/dist.node/models/swid.js +58 -0
  47. package/dist.node/models/swid.js.map +1 -0
  48. package/dist.node/models/tool.js +45 -0
  49. package/dist.node/models/tool.js.map +1 -0
  50. package/dist.node/resources.node.js +55 -0
  51. package/dist.node/resources.node.js.map +1 -0
  52. package/dist.node/serialize/_index.node.js +37 -0
  53. package/dist.node/serialize/_index.node.js.map +1 -0
  54. package/dist.node/serialize/baseSerializer.js +56 -0
  55. package/dist.node/serialize/baseSerializer.js.map +1 -0
  56. package/dist.node/serialize/bomRefDiscriminator.js +66 -0
  57. package/dist.node/serialize/bomRefDiscriminator.js.map +1 -0
  58. package/dist.node/serialize/index.js +55 -0
  59. package/dist.node/serialize/index.js.map +1 -0
  60. package/dist.node/serialize/json/index.js +47 -0
  61. package/dist.node/serialize/json/index.js.map +1 -0
  62. package/dist.node/serialize/json/normalize.js +431 -0
  63. package/dist.node/serialize/json/normalize.js.map +1 -0
  64. package/dist.node/serialize/json/types.js +35 -0
  65. package/dist.node/serialize/json/types.js.map +1 -0
  66. package/dist.node/serialize/jsonSerializer.js +55 -0
  67. package/dist.node/serialize/jsonSerializer.js.map +1 -0
  68. package/dist.node/serialize/types.js +21 -0
  69. package/dist.node/serialize/types.js.map +1 -0
  70. package/dist.node/serialize/xml/index.js +47 -0
  71. package/dist.node/serialize/xml/index.js.map +1 -0
  72. package/dist.node/serialize/xml/normalize.js +560 -0
  73. package/dist.node/serialize/xml/normalize.js.map +1 -0
  74. package/dist.node/serialize/xml/types.js +31 -0
  75. package/dist.node/serialize/xml/types.js.map +1 -0
  76. package/dist.node/serialize/xmlBaseSerializer.js +52 -0
  77. package/dist.node/serialize/xmlBaseSerializer.js.map +1 -0
  78. package/dist.node/serialize/xmlSerializer.node.js +30 -0
  79. package/dist.node/serialize/xmlSerializer.node.js.map +1 -0
  80. package/dist.node/spdx.js +35 -0
  81. package/dist.node/spdx.js.map +1 -0
  82. package/dist.node/spec.js +229 -0
  83. package/dist.node/spec.js.map +1 -0
  84. package/dist.node/types/cpe.js +28 -0
  85. package/dist.node/types/cpe.js.map +1 -0
  86. package/dist.node/types/index.js +39 -0
  87. package/dist.node/types/index.js.map +1 -0
  88. package/dist.node/types/integer.js +36 -0
  89. package/dist.node/types/integer.js.map +1 -0
  90. package/dist.node/types/mimeType.js +28 -0
  91. package/dist.node/types/mimeType.js.map +1 -0
  92. package/dist.node/types/urn.js +28 -0
  93. package/dist.node/types/urn.js.map +1 -0
  94. package/dist.web/lib.dev.js +3487 -0
  95. package/dist.web/lib.dev.js.map +1 -0
  96. package/dist.web/lib.js +2 -0
  97. package/dist.web/lib.js.LICENSE.txt +18 -0
  98. package/libs/universal-node-xml/index.d.ts +33 -0
  99. package/libs/universal-node-xml/index.js +42 -0
  100. package/libs/universal-node-xml/stringifiers/helpers.js +17 -0
  101. package/libs/universal-node-xml/stringifiers/xmlbuilder2.js +51 -0
  102. package/package.json +86 -0
  103. package/res/README.md +27 -0
  104. package/res/bom-1.0.SNAPSHOT.xsd +247 -0
  105. package/res/bom-1.1.SNAPSHOT.xsd +731 -0
  106. package/res/bom-1.2-strict.SNAPSHOT.schema.json +1026 -0
  107. package/res/bom-1.2.SNAPSHOT.schema.json +997 -0
  108. package/res/bom-1.2.SNAPSHOT.xsd +1418 -0
  109. package/res/bom-1.3-strict.SNAPSHOT.schema.json +1085 -0
  110. package/res/bom-1.3.SNAPSHOT.schema.json +1054 -0
  111. package/res/bom-1.3.SNAPSHOT.xsd +1631 -0
  112. package/res/bom-1.4.SNAPSHOT.schema.json +1697 -0
  113. package/res/bom-1.4.SNAPSHOT.xsd +2407 -0
  114. package/res/jsf-0.82.SNAPSHOT.schema.json +244 -0
  115. package/res/spdx.SNAPSHOT.schema.json +533 -0
  116. package/res/spdx.SNAPSHOT.xsd +2639 -0
  117. package/src/_index.node.ts +31 -0
  118. package/src/_index.web.ts +27 -0
  119. package/src/enums/attachmentEncoding.ts +22 -0
  120. package/src/enums/componentScope.ts +24 -0
  121. package/src/enums/componentType.ts +29 -0
  122. package/src/enums/externalReferenceType.ts +37 -0
  123. package/src/enums/hashAlogorithm.ts +33 -0
  124. package/src/enums/index.ts +24 -0
  125. package/src/factories/index.ts +20 -0
  126. package/src/factories/licenseFactory.ts +62 -0
  127. package/src/helpers/README.md +3 -0
  128. package/src/helpers/types.ts +28 -0
  129. package/src/models/attachment.ts +37 -0
  130. package/src/models/bom.ts +85 -0
  131. package/src/models/bomRef.ts +41 -0
  132. package/src/models/component.ts +136 -0
  133. package/src/models/externalReference.ts +48 -0
  134. package/src/models/hash.ts +38 -0
  135. package/src/models/index.ts +31 -0
  136. package/src/models/license.ts +133 -0
  137. package/src/models/metadata.ts +50 -0
  138. package/src/models/organizationalContact.ts +49 -0
  139. package/src/models/organizationalEntity.ts +38 -0
  140. package/src/models/swid.ts +71 -0
  141. package/src/models/tool.ts +58 -0
  142. package/src/resources.node.ts +59 -0
  143. package/src/serialize/_index.node.ts +23 -0
  144. package/src/serialize/_index.web.ts +23 -0
  145. package/src/serialize/baseSerializer.ts +52 -0
  146. package/src/serialize/bomRefDiscriminator.ts +69 -0
  147. package/src/serialize/index.ts +35 -0
  148. package/src/serialize/json/index.ts +23 -0
  149. package/src/serialize/json/normalize.ts +450 -0
  150. package/src/serialize/json/types.ts +187 -0
  151. package/src/serialize/jsonSerializer.ts +59 -0
  152. package/src/serialize/types.ts +38 -0
  153. package/src/serialize/xml/index.ts +23 -0
  154. package/src/serialize/xml/normalize.ts +590 -0
  155. package/src/serialize/xml/types.ts +112 -0
  156. package/src/serialize/xmlBaseSerializer.ts +52 -0
  157. package/src/serialize/xmlSerializer.node.ts +35 -0
  158. package/src/serialize/xmlSerializer.web.ts +89 -0
  159. package/src/spdx.ts +48 -0
  160. package/src/spec.ts +289 -0
  161. package/src/types/cpe.ts +33 -0
  162. package/src/types/index.ts +23 -0
  163. package/src/types/integer.ts +50 -0
  164. package/src/types/mimeType.ts +31 -0
  165. package/src/types/urn.ts +33 -0
  166. package/tsconfig.json +108 -0
  167. package/tsconfig.node.json +8 -0
  168. package/tsconfig.web.json +5 -0
  169. package/webpack.config.js +74 -0
@@ -0,0 +1,731 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!--
3
+ CycloneDX Software Bill-of-Material (SBoM) Specification
4
+
5
+ Licensed under the Apache License, Version 2.0 (the "License");
6
+ you may not use this file except in compliance with the License.
7
+ You may obtain a copy of the License at
8
+
9
+ http://www.apache.org/licenses/LICENSE-2.0
10
+
11
+ Unless required by applicable law or agreed to in writing, software
12
+ distributed under the License is distributed on an "AS IS" BASIS,
13
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ See the License for the specific language governing permissions and
15
+ limitations under the License.
16
+ -->
17
+ <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
18
+ xmlns:vc="http://www.w3.org/2007/XMLSchema-versioning"
19
+ xmlns:bom="http://cyclonedx.org/schema/bom/1.1"
20
+ xmlns:spdx="http://cyclonedx.org/schema/spdx"
21
+ elementFormDefault="qualified"
22
+ targetNamespace="http://cyclonedx.org/schema/bom/1.1"
23
+ vc:minVersion="1.0"
24
+ vc:maxVersion="1.1"
25
+ version="1.1">
26
+
27
+ <xs:import namespace="http://cyclonedx.org/schema/spdx" schemaLocation="spdx.SNAPSHOT.xsd"/>
28
+
29
+ <xs:annotation>
30
+ <xs:documentation>
31
+ <name>CycloneDX Software Bill-of-Material Specification</name>
32
+ <url>https://cyclonedx.org/</url>
33
+ <license uri="http://www.apache.org/licenses/LICENSE-2.0"
34
+ version="2.0">Apache License, Version 2.0</license>
35
+ <authors>
36
+ <author>Steve Springett</author>
37
+ </authors>
38
+ </xs:documentation>
39
+ </xs:annotation>
40
+
41
+ <xs:complexType name="componentsType">
42
+ <xs:sequence minOccurs="0" maxOccurs="unbounded">
43
+ <xs:element name="component" type="bom:component"/>
44
+ <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded">
45
+ <xs:annotation>
46
+ <xs:documentation>
47
+ Allows any undeclared elements as long as the elements are placed in a different namespace.
48
+ </xs:documentation>
49
+ </xs:annotation>
50
+ </xs:any>
51
+ </xs:sequence>
52
+ <xs:anyAttribute namespace="##any" processContents="lax">
53
+ <xs:annotation>
54
+ <xs:documentation>User-defined attributes may be used on this element as long as they
55
+ do not have the same name as an existing attribute used by the schema.</xs:documentation>
56
+ </xs:annotation>
57
+ </xs:anyAttribute>
58
+ </xs:complexType>
59
+
60
+ <xs:complexType name="component">
61
+ <xs:sequence>
62
+ <xs:element name="publisher" type="xs:normalizedString" minOccurs="0" maxOccurs="1">
63
+ <xs:annotation>
64
+ <xs:documentation>The person(s) or organization(s) that published the component</xs:documentation>
65
+ </xs:annotation>
66
+ </xs:element>
67
+ <xs:element name="group" type="xs:normalizedString" minOccurs="0" maxOccurs="1">
68
+ <xs:annotation>
69
+ <xs:documentation>The grouping name or identifier. This will often be a shortened, single
70
+ name of the company or project that produced the component, or the source package or
71
+ domain name. Whitespace and special characters should be avoided. Examples include:
72
+ apache, org.apache.commons, and apache.org.</xs:documentation>
73
+ </xs:annotation>
74
+ </xs:element>
75
+ <xs:element name="name" type="xs:normalizedString" minOccurs="1" maxOccurs="1">
76
+ <xs:annotation>
77
+ <xs:documentation>The name of the component. This will often be a shortened, single name
78
+ of the component. Examples: commons-lang3 and jquery</xs:documentation>
79
+ </xs:annotation>
80
+ </xs:element>
81
+ <xs:element name="version" type="xs:normalizedString" minOccurs="1" maxOccurs="1">
82
+ <xs:annotation>
83
+ <xs:documentation>The component version. The version should ideally comply with semantic versioning
84
+ but is not enforced.</xs:documentation>
85
+ </xs:annotation>
86
+ </xs:element>
87
+ <xs:element name="description" type="xs:normalizedString" minOccurs="0" maxOccurs="1">
88
+ <xs:annotation>
89
+ <xs:documentation>Specifies a description for the component</xs:documentation>
90
+ </xs:annotation>
91
+ </xs:element>
92
+ <xs:element name="scope" type="bom:scope" minOccurs="0" maxOccurs="1">
93
+ <xs:annotation>
94
+ <xs:documentation>Specifies the scope of the component. If scope is not specified, 'runtime'
95
+ scope should be assumed by the consumer of the BOM</xs:documentation>
96
+ </xs:annotation>
97
+ </xs:element>
98
+ <xs:element name="hashes" minOccurs="0" maxOccurs="1">
99
+ <xs:complexType>
100
+ <xs:sequence minOccurs="0" maxOccurs="unbounded">
101
+ <xs:element name="hash" type="bom:hashType"/>
102
+ </xs:sequence>
103
+ </xs:complexType>
104
+ </xs:element>
105
+ <xs:element name="licenses" minOccurs="0" maxOccurs="1">
106
+ <xs:complexType>
107
+ <xs:choice>
108
+ <xs:element name="license" type="bom:licenseType" minOccurs="0" maxOccurs="unbounded"/>
109
+ <xs:element name="expression" type="xs:normalizedString" minOccurs="0" maxOccurs="1">
110
+ <xs:annotation>
111
+ <xs:documentation>A valid SPDX license expression.
112
+ Refer to https://spdx.org/specifications for syntax requirements</xs:documentation>
113
+ </xs:annotation>
114
+ </xs:element>
115
+ </xs:choice>
116
+ </xs:complexType>
117
+ </xs:element>
118
+ <xs:element name="copyright" type="xs:normalizedString" minOccurs="0" maxOccurs="1">
119
+ <xs:annotation>
120
+ <xs:documentation>An optional copyright notice informing users of the underlying claims to
121
+ copyright ownership in a published work.</xs:documentation>
122
+ </xs:annotation>
123
+ </xs:element>
124
+ <xs:element name="cpe" type="bom:cpe" minOccurs="0" maxOccurs="1">
125
+ <xs:annotation>
126
+ <xs:documentation>
127
+ DEPRECATED - DO NOT USE. This will be removed in a future version.
128
+ Specifies a well-formed CPE name. See https://nvd.nist.gov/products/cpe
129
+ </xs:documentation>
130
+ </xs:annotation>
131
+ </xs:element>
132
+ <xs:element name="purl" type="xs:anyURI" minOccurs="0" maxOccurs="1">
133
+ <xs:annotation>
134
+ <xs:documentation>
135
+ Specifies the package-url (PURL). The purl, if specified, must be valid and conform
136
+ to the specification defined at: https://github.com/package-url/purl-spec
137
+ </xs:documentation>
138
+ </xs:annotation>
139
+ </xs:element>
140
+ <xs:element name="modified" type="xs:boolean" minOccurs="0" maxOccurs="1">
141
+ <xs:annotation>
142
+ <xs:documentation>
143
+ DEPRECATED - DO NOT USE. This will be removed in a future version. Use the pedigree
144
+ element instead to supply information on exactly how the component was modified.
145
+ A boolean value indicating is the component has been modified from the original.
146
+ A value of true indicates the component is a derivative of the original.
147
+ A value of false indicates the component has not been modified from the original.
148
+ </xs:documentation>
149
+ </xs:annotation>
150
+ </xs:element>
151
+ <xs:element name="pedigree" type="bom:pedigreeType" minOccurs="0" maxOccurs="1">
152
+ <xs:annotation>
153
+ <xs:documentation>
154
+ Component pedigree is a way to document complex supply chain scenarios where components are
155
+ created, distributed, modified, redistributed, combined with other components, etc.
156
+ </xs:documentation>
157
+ </xs:annotation>
158
+ </xs:element>
159
+ <xs:element name="externalReferences" type="bom:externalReferences" minOccurs="0" maxOccurs="1">
160
+ <xs:annotation>
161
+ <xs:documentation>Provides the ability to document external references related to the
162
+ component or to the project the component describes.</xs:documentation>
163
+ </xs:annotation>
164
+ </xs:element>
165
+ <xs:element name="components" minOccurs="0" maxOccurs="1">
166
+ <xs:annotation>
167
+ <xs:documentation>
168
+ Specifies optional sub-components. This is not a dependency tree. It provides a way
169
+ to specify a hierarchical representation of component assemblies, similar to
170
+ system -> subsystem -> parts assembly in physical supply chains.
171
+ </xs:documentation>
172
+ </xs:annotation>
173
+ <xs:complexType>
174
+ <xs:sequence minOccurs="0" maxOccurs="unbounded">
175
+ <xs:element name="component" type="bom:component"/>
176
+ <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded">
177
+ <xs:annotation>
178
+ <xs:documentation>
179
+ Allows any undeclared elements as long as the elements are placed in a different namespace.
180
+ </xs:documentation>
181
+ </xs:annotation>
182
+ </xs:any>
183
+ </xs:sequence>
184
+ </xs:complexType>
185
+ </xs:element>
186
+ <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded">
187
+ <xs:annotation>
188
+ <xs:documentation>
189
+ Allows any undeclared elements as long as the elements are placed in a different namespace.
190
+ </xs:documentation>
191
+ </xs:annotation>
192
+ </xs:any>
193
+ </xs:sequence>
194
+ <xs:attribute name="type" type="bom:classification" use="required">
195
+ <xs:annotation>
196
+ <xs:documentation>
197
+ Specifies the type of component. For software components, classify as application if no more
198
+ specific appropriate classification is available or cannot be determined for the component.
199
+ Valid choices are: application, framework, library, operating-system, device, or file
200
+ Refer to the bom:classification documentation for information describing each one
201
+ </xs:documentation>
202
+ </xs:annotation>
203
+ </xs:attribute>
204
+ <xs:attribute name="bom-ref" type="xs:string">
205
+ <xs:annotation>
206
+ <xs:documentation>
207
+ An optional identifier which can be used to reference the component elsewhere in the BOM.
208
+ Uniqueness is enforced within all elements and children of the root-level bom element.
209
+ </xs:documentation>
210
+ </xs:annotation>
211
+ </xs:attribute>
212
+ <xs:anyAttribute namespace="##any" processContents="lax">
213
+ <xs:annotation>
214
+ <xs:documentation>User-defined attributes may be used on this element as long as they
215
+ do not have the same name as an existing attribute used by the schema.</xs:documentation>
216
+ </xs:annotation>
217
+ </xs:anyAttribute>
218
+ </xs:complexType>
219
+
220
+ <xs:complexType name="licenseType">
221
+ <xs:sequence>
222
+ <xs:choice>
223
+ <xs:element name="id" type="spdx:licenseId" minOccurs="0" maxOccurs="1">
224
+ <xs:annotation>
225
+ <xs:documentation>A valid SPDX license ID</xs:documentation>
226
+ </xs:annotation>
227
+ </xs:element>
228
+ <xs:element name="name" type="xs:normalizedString" minOccurs="0" maxOccurs="1">
229
+ <xs:annotation>
230
+ <xs:documentation>If SPDX does not define the license used, this field may be used to provide the license name</xs:documentation>
231
+ </xs:annotation>
232
+ </xs:element>
233
+ </xs:choice>
234
+ <xs:element name="text" type="bom:licenseTextType" minOccurs="0" maxOccurs="1">
235
+ <xs:annotation>
236
+ <xs:documentation>Specifies the optional full text of the license</xs:documentation>
237
+ </xs:annotation>
238
+ </xs:element>
239
+ <xs:element name="url" type="xs:anyURI" minOccurs="0" maxOccurs="1">
240
+ <xs:annotation>
241
+ <xs:documentation>The URL to the license file. If specified, a 'license'
242
+ externalReference should also be specified for completeness.</xs:documentation>
243
+ </xs:annotation>
244
+ </xs:element>
245
+ <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded">
246
+ <xs:annotation>
247
+ <xs:documentation>
248
+ Allows any undeclared elements as long as the elements are placed in a different namespace.
249
+ </xs:documentation>
250
+ </xs:annotation>
251
+ </xs:any>
252
+ </xs:sequence>
253
+ </xs:complexType>
254
+
255
+ <xs:complexType name="licenseTextType">
256
+ <xs:simpleContent>
257
+ <xs:extension base="xs:string">
258
+ <xs:annotation>
259
+ <xs:documentation>Specifies attributes of the license text</xs:documentation>
260
+ </xs:annotation>
261
+ <xs:attribute name="content-type" type="xs:normalizedString" default="text/plain">
262
+ <xs:annotation>
263
+ <xs:documentation>Specifies the content type of the license text. Defaults to text/plain
264
+ if not specified.</xs:documentation>
265
+ </xs:annotation>
266
+ </xs:attribute>
267
+ <xs:attribute name="encoding" type="bom:encoding">
268
+ <xs:annotation>
269
+ <xs:documentation>
270
+ Specifies the optional encoding the license text is represented in
271
+ </xs:documentation>
272
+ </xs:annotation>
273
+ </xs:attribute>
274
+ </xs:extension>
275
+ </xs:simpleContent>
276
+ </xs:complexType>
277
+
278
+ <xs:complexType name="hashType">
279
+ <xs:annotation>
280
+ <xs:documentation>Specifies the file hash of the component</xs:documentation>
281
+ </xs:annotation>
282
+ <xs:simpleContent>
283
+ <xs:extension base="bom:hashValue">
284
+ <xs:attribute name="alg" type="bom:hashAlg" use="required">
285
+ <xs:annotation>
286
+ <xs:documentation>Specifies the algorithm used to create the hash</xs:documentation>
287
+ </xs:annotation>
288
+ </xs:attribute>
289
+ </xs:extension>
290
+ </xs:simpleContent>
291
+ </xs:complexType>
292
+
293
+ <xs:simpleType name="scope">
294
+ <xs:restriction base="xs:string">
295
+ <xs:enumeration value="required">
296
+ <xs:annotation>
297
+ <xs:documentation>The component is required for runtime</xs:documentation>
298
+ </xs:annotation>
299
+ </xs:enumeration>
300
+ <xs:enumeration value="optional">
301
+ <xs:annotation>
302
+ <xs:documentation>The component is optional at runtime. Optional components are components that
303
+ are not capable of being called due to them not be installed or otherwise accessible by any means.
304
+ Components that are installed but due to configuration or other restrictions are prohibited from
305
+ being called must be scoped as 'required'.</xs:documentation>
306
+ </xs:annotation>
307
+ </xs:enumeration>
308
+ <xs:enumeration value="excluded">
309
+ <xs:annotation>
310
+ <xs:documentation>Components that are excluded provide the ability to document component usage
311
+ for test and other non-runtime purposes. Excluded components are not reachable within a call
312
+ graph at runtime.</xs:documentation>
313
+ </xs:annotation>
314
+ </xs:enumeration>
315
+ </xs:restriction>
316
+ </xs:simpleType>
317
+
318
+ <xs:simpleType name="classification">
319
+ <xs:restriction base="xs:string">
320
+ <xs:enumeration value="application">
321
+ <xs:annotation>
322
+ <xs:documentation>A software application. Refer to https://en.wikipedia.org/wiki/Application_software
323
+ for information about applications.</xs:documentation>
324
+ </xs:annotation>
325
+ </xs:enumeration>
326
+ <xs:enumeration value="framework">
327
+ <xs:annotation>
328
+ <xs:documentation>A software framework. Refer to https://en.wikipedia.org/wiki/Software_framework
329
+ for information on how frameworks vary slightly from libraries.</xs:documentation>
330
+ </xs:annotation>
331
+ </xs:enumeration>
332
+ <xs:enumeration value="library">
333
+ <xs:annotation>
334
+ <xs:documentation>A software library. Refer to https://en.wikipedia.org/wiki/Library_(computing)
335
+ for information about libraries. All third-party and open source reusable components will likely
336
+ be a library. If the library also has key features of a framework, then it should be classified
337
+ as a framework. If not, or is unknown, then specifying library is recommended.</xs:documentation>
338
+ </xs:annotation>
339
+ </xs:enumeration>
340
+ <xs:enumeration value="operating-system">
341
+ <xs:annotation>
342
+ <xs:documentation>A software operating system without regard to deployment model
343
+ (i.e. installed on physical hardware, virtual machine, container image, etc) Refer to
344
+ https://en.wikipedia.org/wiki/Operating_system</xs:documentation>
345
+ </xs:annotation>
346
+ </xs:enumeration>
347
+ <xs:enumeration value="device">
348
+ <xs:annotation>
349
+ <xs:documentation>A hardware device such as a processor, or chip-set. A hardware device
350
+ containing firmware should include a component for the physical hardware itself, and another
351
+ component of type 'application' or 'operating-system' (whichever is relevant), describing
352
+ information about the firmware.</xs:documentation>
353
+ </xs:annotation>
354
+ </xs:enumeration>
355
+ <xs:enumeration value="file">
356
+ <xs:annotation>
357
+ <xs:documentation>A computer file. Refer to https://en.wikipedia.org/wiki/Computer_file
358
+ for information about files.</xs:documentation>
359
+ </xs:annotation>
360
+ </xs:enumeration>
361
+ </xs:restriction>
362
+ </xs:simpleType>
363
+
364
+ <xs:simpleType name="hashAlg">
365
+ <xs:restriction base="xs:string">
366
+ <xs:enumeration value="MD5"/>
367
+ <xs:enumeration value="SHA-1"/>
368
+ <xs:enumeration value="SHA-256"/>
369
+ <xs:enumeration value="SHA-384"/>
370
+ <xs:enumeration value="SHA-512"/>
371
+ <xs:enumeration value="SHA3-256"/>
372
+ <xs:enumeration value="SHA3-512"/>
373
+ </xs:restriction>
374
+ </xs:simpleType>
375
+
376
+ <xs:simpleType name="hashValue">
377
+ <xs:restriction base="xs:token">
378
+ <xs:pattern value="([a-fA-F0-9]{32})|([a-fA-F0-9]{40})|([a-fA-F0-9]{64})|([a-fA-F0-9]{96})|([a-fA-F0-9]{128})"/>
379
+ </xs:restriction>
380
+ </xs:simpleType>
381
+
382
+ <xs:simpleType name="encoding">
383
+ <xs:restriction base="xs:string">
384
+ <xs:enumeration value="base64"/>
385
+ </xs:restriction>
386
+ </xs:simpleType>
387
+
388
+ <xs:simpleType name="cpe">
389
+ <xs:annotation>
390
+ <xs:documentation xml:lang="en">
391
+ Define the format for acceptable CPE URIs. Supports CPE 2.2 and CPE 2.3 formats.
392
+ Refer to https://nvd.nist.gov/products/cpe for official specification.
393
+ </xs:documentation>
394
+ </xs:annotation>
395
+ <xs:restriction base="xs:string">
396
+ <xs:pattern value="([c][pP][eE]:/[AHOaho]?(:[A-Za-z0-9\._\-~%]*){0,6})|(cpe:2\.3:[aho\*\-](:(((\?*|\*?)([a-zA-Z0-9\-\._]|(\\[\\\*\?!&quot;#$$%&amp;'\(\)\+,/:;&lt;=&gt;@\[\]\^`\{\|}~]))+(\?*|\*?))|[\*\-])){5}(:(([a-zA-Z]{2,3}(-([a-zA-Z]{2}|[0-9]{3}))?)|[\*\-]))(:(((\?*|\*?)([a-zA-Z0-9\-\._]|(\\[\\\*\?!&quot;#$$%&amp;'\(\)\+,/:;&lt;=&gt;@\[\]\^`\{\|}~]))+(\?*|\*?))|[\*\-])){4})"/>
397
+ </xs:restriction>
398
+ </xs:simpleType>
399
+
400
+ <xs:simpleType name="urnUuid">
401
+ <xs:annotation>
402
+ <xs:documentation xml:lang="en">
403
+ Defines a string representation of a UUID conforming to RFC 4122.
404
+ </xs:documentation>
405
+ </xs:annotation>
406
+ <xs:restriction base="xs:string">
407
+ <xs:pattern value="urn:uuid:([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})|(\{[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\})"/>
408
+ </xs:restriction>
409
+ </xs:simpleType>
410
+
411
+ <xs:simpleType name="externalReferenceType">
412
+ <xs:restriction base="xs:string">
413
+ <xs:enumeration value="vcs">
414
+ <xs:annotation>
415
+ <xs:documentation>Version Control System</xs:documentation>
416
+ </xs:annotation>
417
+ </xs:enumeration>
418
+ <xs:enumeration value="issue-tracker">
419
+ <xs:annotation>
420
+ <xs:documentation>Issue or defect tracking system, or an Application Lifecycle Management (ALM) system</xs:documentation>
421
+ </xs:annotation>
422
+ </xs:enumeration>
423
+ <xs:enumeration value="website">
424
+ <xs:annotation>
425
+ <xs:documentation>Website</xs:documentation>
426
+ </xs:annotation>
427
+ </xs:enumeration>
428
+ <xs:enumeration value="advisories">
429
+ <xs:annotation>
430
+ <xs:documentation>Security advisories</xs:documentation>
431
+ </xs:annotation>
432
+ </xs:enumeration>
433
+ <xs:enumeration value="bom">
434
+ <xs:annotation>
435
+ <xs:documentation>Bill-of-material document (CycloneDX, SPDX, SWID, etc)</xs:documentation>
436
+ </xs:annotation>
437
+ </xs:enumeration>
438
+ <xs:enumeration value="mailing-list">
439
+ <xs:annotation>
440
+ <xs:documentation>Mailing list or discussion group</xs:documentation>
441
+ </xs:annotation>
442
+ </xs:enumeration>
443
+ <xs:enumeration value="social">
444
+ <xs:annotation>
445
+ <xs:documentation>Social media account</xs:documentation>
446
+ </xs:annotation>
447
+ </xs:enumeration>
448
+ <xs:enumeration value="chat">
449
+ <xs:annotation>
450
+ <xs:documentation>Real-time chat platform</xs:documentation>
451
+ </xs:annotation>
452
+ </xs:enumeration>
453
+ <xs:enumeration value="documentation">
454
+ <xs:annotation>
455
+ <xs:documentation>Documentation, guides, or how-to instructions</xs:documentation>
456
+ </xs:annotation>
457
+ </xs:enumeration>
458
+ <xs:enumeration value="support">
459
+ <xs:annotation>
460
+ <xs:documentation>Community or commercial support</xs:documentation>
461
+ </xs:annotation>
462
+ </xs:enumeration>
463
+ <xs:enumeration value="distribution">
464
+ <xs:annotation>
465
+ <xs:documentation>Direct or repository download location</xs:documentation>
466
+ </xs:annotation>
467
+ </xs:enumeration>
468
+ <xs:enumeration value="license">
469
+ <xs:annotation>
470
+ <xs:documentation>The URL to the license file. If a license URL has been defined in the license
471
+ node, it should also be defined as an external reference for completeness</xs:documentation>
472
+ </xs:annotation>
473
+ </xs:enumeration>
474
+ <xs:enumeration value="build-meta">
475
+ <xs:annotation>
476
+ <xs:documentation>Build-system specific meta file (i.e. pom.xml, package.json, .nuspec, etc)</xs:documentation>
477
+ </xs:annotation>
478
+ </xs:enumeration>
479
+ <xs:enumeration value="build-system">
480
+ <xs:annotation>
481
+ <xs:documentation>URL to an automated build system</xs:documentation>
482
+ </xs:annotation>
483
+ </xs:enumeration>
484
+ <xs:enumeration value="other">
485
+ <xs:annotation>
486
+ <xs:documentation>Use this if no other types accurately describe the purpose of the external reference</xs:documentation>
487
+ </xs:annotation>
488
+ </xs:enumeration>
489
+ </xs:restriction>
490
+ </xs:simpleType>
491
+
492
+ <xs:complexType name="externalReferences">
493
+ <xs:annotation>
494
+ <xs:documentation xml:lang="en">
495
+ External references provide a way to document systems, sites, and information that may be relevant
496
+ but which are not included with the BOM.
497
+ </xs:documentation>
498
+ </xs:annotation>
499
+ <xs:sequence minOccurs="0" maxOccurs="unbounded">
500
+ <xs:element name="reference" type="bom:externalReference">
501
+ <xs:annotation>
502
+ <xs:documentation xml:lang="en">Zero or more external references can be defined</xs:documentation>
503
+ </xs:annotation>
504
+ </xs:element>
505
+ </xs:sequence>
506
+ </xs:complexType>
507
+
508
+ <xs:complexType name="externalReference">
509
+ <xs:sequence>
510
+ <xs:element name="url" type="xs:anyURI" minOccurs="1" maxOccurs="1">
511
+ <xs:annotation>
512
+ <xs:documentation xml:lang="en">The URL to the external reference</xs:documentation>
513
+ </xs:annotation>
514
+ </xs:element>
515
+ <xs:element name="comment" type="xs:string" minOccurs="0" maxOccurs="1">
516
+ <xs:annotation>
517
+ <xs:documentation xml:lang="en">An optional comment describing the external reference</xs:documentation>
518
+ </xs:annotation>
519
+ </xs:element>
520
+ </xs:sequence>
521
+ <xs:attribute name="type" type="bom:externalReferenceType" use="required">
522
+ <xs:annotation>
523
+ <xs:documentation>Specifies the type of external reference. There are built-in types to describe common
524
+ references. If a type does not exist for the reference being referred to, use the "other" type.
525
+ </xs:documentation>
526
+ </xs:annotation>
527
+ </xs:attribute>
528
+ <xs:anyAttribute namespace="##any" processContents="lax">
529
+ <xs:annotation>
530
+ <xs:documentation>User-defined attributes may be used on this element as long as they
531
+ do not have the same name as an existing attribute used by the schema.</xs:documentation>
532
+ </xs:annotation>
533
+ </xs:anyAttribute>
534
+ </xs:complexType>
535
+
536
+ <xs:complexType name="commitsType">
537
+ <xs:annotation>
538
+ <xs:documentation xml:lang="en">Zero or more commits can be specified.</xs:documentation>
539
+ </xs:annotation>
540
+ <xs:sequence minOccurs="0" maxOccurs="unbounded">
541
+ <xs:element name="commit" type="bom:commitType">
542
+ <xs:annotation>
543
+ <xs:documentation xml:lang="en">Specifies an individual commit.</xs:documentation>
544
+ </xs:annotation>
545
+ </xs:element>
546
+ <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded">
547
+ <xs:annotation>
548
+ <xs:documentation>
549
+ Allows any undeclared elements as long as the elements are placed in a different namespace.
550
+ </xs:documentation>
551
+ </xs:annotation>
552
+ </xs:any>
553
+ </xs:sequence>
554
+ </xs:complexType>
555
+
556
+ <xs:complexType name="commitType">
557
+ <xs:sequence>
558
+ <xs:element name="uid" type="xs:normalizedString" minOccurs="0" maxOccurs="1">
559
+ <xs:annotation>
560
+ <xs:documentation xml:lang="en">A unique identifier of the commit. This may be version control
561
+ specific. For example, Subversion uses revision numbers whereas git uses commit hashes.
562
+ </xs:documentation>
563
+ </xs:annotation>
564
+ </xs:element>
565
+ <xs:element name="url" type="xs:anyURI" minOccurs="0" maxOccurs="1">
566
+ <xs:annotation>
567
+ <xs:documentation xml:lang="en">The URL to the commit. This URL will typically point to a commit
568
+ in a version control system.
569
+ </xs:documentation>
570
+ </xs:annotation>
571
+ </xs:element>
572
+ <xs:element name="author" type="bom:identifiableActionType" minOccurs="0" maxOccurs="1">
573
+ <xs:annotation>
574
+ <xs:documentation xml:lang="en">The author who created the changes in the commit</xs:documentation>
575
+ </xs:annotation>
576
+ </xs:element>
577
+ <xs:element name="committer" type="bom:identifiableActionType" minOccurs="0" maxOccurs="1">
578
+ <xs:annotation>
579
+ <xs:documentation xml:lang="en">The person who committed or pushed the commit</xs:documentation>
580
+ </xs:annotation>
581
+ </xs:element>
582
+ <xs:element name="message" type="xs:normalizedString" minOccurs="0" maxOccurs="1">
583
+ <xs:annotation>
584
+ <xs:documentation xml:lang="en">The text description of the contents of the commit</xs:documentation>
585
+ </xs:annotation>
586
+ </xs:element>
587
+ <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded">
588
+ <xs:annotation>
589
+ <xs:documentation>
590
+ Allows any undeclared elements as long as the elements are placed in a different namespace.
591
+ </xs:documentation>
592
+ </xs:annotation>
593
+ </xs:any>
594
+ </xs:sequence>
595
+ </xs:complexType>
596
+
597
+ <xs:complexType name="identifiableActionType">
598
+ <xs:sequence>
599
+ <xs:element name="timestamp" type="xs:dateTime" minOccurs="0" maxOccurs="1">
600
+ <xs:annotation>
601
+ <xs:documentation xml:lang="en">The timestamp in which the action occurred</xs:documentation>
602
+ </xs:annotation>
603
+ </xs:element>
604
+ <xs:element name="name" type="xs:normalizedString" minOccurs="0" maxOccurs="1">
605
+ <xs:annotation>
606
+ <xs:documentation xml:lang="en">The name of the individual who performed the action</xs:documentation>
607
+ </xs:annotation>
608
+ </xs:element>
609
+ <xs:element name="email" type="xs:normalizedString" minOccurs="0" maxOccurs="1">
610
+ <xs:annotation>
611
+ <xs:documentation xml:lang="en">The email address of the individual who performed the action</xs:documentation>
612
+ </xs:annotation>
613
+ </xs:element>
614
+ <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded">
615
+ <xs:annotation>
616
+ <xs:documentation>
617
+ Allows any undeclared elements as long as the elements are placed in a different namespace.
618
+ </xs:documentation>
619
+ </xs:annotation>
620
+ </xs:any>
621
+ </xs:sequence>
622
+ </xs:complexType>
623
+
624
+ <xs:complexType name="pedigreeType">
625
+ <xs:annotation>
626
+ <xs:documentation xml:lang="en">
627
+ Component pedigree is a way to document complex supply chain scenarios where components are created,
628
+ distributed, modified, redistributed, combined with other components, etc. Pedigree supports viewing
629
+ this complex chain from the beginning, the end, or anywhere in the middle. It also provides a way to
630
+ document variants where the exact relation may not be known.
631
+ </xs:documentation>
632
+ </xs:annotation>
633
+ <xs:sequence>
634
+ <xs:element name="ancestors" type="bom:componentsType" minOccurs="0" maxOccurs="1">
635
+ <xs:annotation>
636
+ <xs:documentation xml:lang="en">Describes zero or more components in which a component is derived
637
+ from. This is commonly used to describe forks from existing projects where the forked version
638
+ contains a ancestor node containing the original component it was forked from. For example,
639
+ Component A is the original component. Component B is the component being used and documented
640
+ in the BOM. However, Component B contains a pedigree node with a single ancestor documenting
641
+ Component A - the original component from which Component B is derived from.
642
+ </xs:documentation>
643
+ </xs:annotation>
644
+ </xs:element>
645
+ <xs:element name="descendants" type="bom:componentsType" minOccurs="0" maxOccurs="1">
646
+ <xs:annotation>
647
+ <xs:documentation xml:lang="en">Descendants are the exact opposite of ancestors. This provides a
648
+ way to document all forks (and their forks) of an original or root component.
649
+ </xs:documentation>
650
+ </xs:annotation>
651
+ </xs:element>
652
+ <xs:element name="variants" type="bom:componentsType" minOccurs="0" maxOccurs="1">
653
+ <xs:annotation>
654
+ <xs:documentation xml:lang="en">Variants describe relations where the relationship between the
655
+ components are not known. For example, if Component A contains nearly identical code to
656
+ Component B. They are both related, but it is unclear if one is derived from the other,
657
+ or if they share a common ancestor.
658
+ </xs:documentation>
659
+ </xs:annotation>
660
+ </xs:element>
661
+ <xs:element name="commits" type="bom:commitsType" minOccurs="0" maxOccurs="1">
662
+ <xs:annotation>
663
+ <xs:documentation xml:lang="en">A list of zero or more commits which provide a trail describing
664
+ how the component deviates from an ancestor, descendant, or variant.</xs:documentation>
665
+ </xs:annotation>
666
+ </xs:element>
667
+ <xs:element name="notes" type="xs:string" minOccurs="0" maxOccurs="1">
668
+ <xs:annotation>
669
+ <xs:documentation xml:lang="en">Notes, observations, and other non-structured commentary
670
+ describing the components pedigree.
671
+ </xs:documentation>
672
+ </xs:annotation>
673
+ </xs:element>
674
+ <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded">
675
+ <xs:annotation>
676
+ <xs:documentation>
677
+ Allows any undeclared elements as long as the elements are placed in a different namespace.
678
+ </xs:documentation>
679
+ </xs:annotation>
680
+ </xs:any>
681
+ </xs:sequence>
682
+ </xs:complexType>
683
+
684
+ <xs:element name="bom">
685
+ <xs:complexType>
686
+ <xs:sequence>
687
+ <xs:element name="components" type="bom:componentsType"/>
688
+ <xs:element name="externalReferences" type="bom:externalReferences" minOccurs="0" maxOccurs="1">
689
+ <xs:annotation>
690
+ <xs:documentation>Provides the ability to document external references related to the BOM or
691
+ to the project the BOM describes.</xs:documentation>
692
+ </xs:annotation>
693
+ </xs:element>
694
+ <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded">
695
+ <xs:annotation>
696
+ <xs:documentation>
697
+ Allows any undeclared elements as long as the elements are placed in a different namespace.
698
+ </xs:documentation>
699
+ </xs:annotation>
700
+ </xs:any>
701
+ </xs:sequence>
702
+ <xs:attribute name="version" type="xs:integer" default="1">
703
+ <xs:annotation>
704
+ <xs:documentation>The version allows component publishers/authors to make changes to existing
705
+ BOMs to update various aspects of the document such as description or licenses. When a system
706
+ is presented with multiple BOMs for the same component, the system should use the most recent
707
+ version of the BOM. The default version is '1' and should be incremented for each version of the
708
+ BOM that is published. Each version of a component should have a unique BOM and if no changes are
709
+ made to the BOMs, then each BOM will have a version of '1'.</xs:documentation>
710
+ </xs:annotation>
711
+ </xs:attribute>
712
+ <xs:attribute name="serialNumber" type="bom:urnUuid">
713
+ <xs:annotation>
714
+ <xs:documentation>Every BOM generated should have a unique serial number, even if the contents
715
+ of the BOM being generated have not changed over time. The process or tool responsible for
716
+ creating the BOM should create random UUID's for every BOM generated.</xs:documentation>
717
+ </xs:annotation>
718
+ </xs:attribute>
719
+ <xs:anyAttribute namespace="##any" processContents="lax">
720
+ <xs:annotation>
721
+ <xs:documentation>User-defined attributes may be used on this element as long as they
722
+ do not have the same name as an existing attribute used by the schema.</xs:documentation>
723
+ </xs:annotation>
724
+ </xs:anyAttribute>
725
+ </xs:complexType>
726
+ <xs:unique name="bom-ref">
727
+ <xs:selector xpath=".//*"/>
728
+ <xs:field xpath="@bom-ref"/>
729
+ </xs:unique>
730
+ </xs:element>
731
+ </xs:schema>