@cdxgen/cdxgen 13.6.0 → 13.7.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.
Files changed (264) hide show
  1. package/README.md +15 -8
  2. package/bin/audit.js +7 -4
  3. package/bin/cdxgen.js +256 -37
  4. package/bin/convert.js +146 -22
  5. package/bin/evinse.js +25 -3
  6. package/bin/repl.js +47 -3
  7. package/bin/sign.js +211 -34
  8. package/bin/tracebom.js +18 -6
  9. package/bin/validate.js +18 -3
  10. package/bin/verify.js +113 -5
  11. package/data/behavior-taxonomy.schema.json +1491 -0
  12. package/data/cyclonedx-2.0-bundled.schema.json +18606 -5528
  13. package/data/cyclonedx-2.0-cryptography-defs.schema.json +857 -0
  14. package/data/pqc-migration.json +239 -0
  15. package/data/remediations.json +52 -0
  16. package/data/rules/cbom-security.yaml +4 -3
  17. package/data/rules/package-integrity.yaml +28 -0
  18. package/lib/audit/index.js +25 -3
  19. package/lib/cli/bomAssembly.js +80 -1
  20. package/lib/cli/cliOptions.js +121 -17
  21. package/lib/cli/index.js +609 -898
  22. package/lib/cli/jsBom.js +3 -0
  23. package/lib/cli/jvmBom.js +365 -40
  24. package/lib/cli/managedBom.js +19 -3
  25. package/lib/cli/nativeBom.js +10 -0
  26. package/lib/core/env.js +26 -0
  27. package/lib/core/fs.js +126 -3
  28. package/lib/core/globPatterns.js +218 -0
  29. package/lib/core/processTree.js +99 -12
  30. package/lib/core/projectConfig.js +332 -25
  31. package/lib/core/toolRegistry.js +15 -1
  32. package/lib/ecosystems/denoutils.js +2 -2
  33. package/lib/ecosystems/golem.js +3 -8
  34. package/lib/ecosystems/gradleutils.js +1082 -6
  35. package/lib/ecosystems/jsEvidence.js +90 -38
  36. package/lib/ecosystems/kosi.js +3 -5
  37. package/lib/ecosystems/npmVersionResolution.js +376 -0
  38. package/lib/ecosystems/parsers-python.js +89 -28
  39. package/lib/ecosystems/parsers-rust.js +117 -15
  40. package/lib/ecosystems/remote/huggingface.js +22 -0
  41. package/lib/ecosystems/rusi.js +2 -4
  42. package/lib/ecosystems/scalasem.js +2 -1
  43. package/lib/evinser/evinser.js +196 -34
  44. package/lib/evinser/scalasem.js +5 -1
  45. package/lib/helpers/agenticToolutils.js +112 -1
  46. package/lib/helpers/bomSigner.js +43 -9
  47. package/lib/helpers/jssSigner.js +1276 -0
  48. package/lib/inventory/agentBlueprint.js +193 -0
  49. package/lib/inventory/agentToolNames.js +145 -0
  50. package/lib/inventory/aiCollector.js +153 -7
  51. package/lib/inventory/aiInventory.js +44 -8
  52. package/lib/inventory/aiProviders.js +324 -0
  53. package/lib/inventory/bomUtils.js +8 -1
  54. package/lib/inventory/ciParsers/githubActionsLock.js +821 -0
  55. package/lib/inventory/citations.js +31 -2
  56. package/lib/inventory/communityAiConfigParser.js +978 -80
  57. package/lib/inventory/cyclonedx20.js +152 -0
  58. package/lib/inventory/cyclonedx20Common.js +286 -0
  59. package/lib/inventory/cyclonedx20Derived.js +159 -0
  60. package/lib/inventory/cyclonedx20Parties.js +552 -0
  61. package/lib/inventory/cyclonedx20Read.js +768 -0
  62. package/lib/inventory/cyclonedx20ReadCommon.js +374 -0
  63. package/lib/inventory/cyclonedx20ReadComponents.js +692 -0
  64. package/lib/inventory/cyclonedx20ReadContext.js +380 -0
  65. package/lib/inventory/cyclonedx20ReadEvidence.js +466 -0
  66. package/lib/inventory/cyclonedx20ReadSections.js +599 -0
  67. package/lib/inventory/cyclonedx20Render.js +766 -0
  68. package/lib/inventory/cyclonedx20RenderComponents.js +716 -0
  69. package/lib/inventory/cyclonedx20RenderDefinitions.js +405 -0
  70. package/lib/inventory/cyclonedx20RenderEvidence.js +726 -0
  71. package/lib/inventory/cyclonedx20RenderHardware.js +203 -0
  72. package/lib/inventory/cyclonedx20RenderPatents.js +174 -0
  73. package/lib/inventory/cyclonedx20RenderRefIds.js +314 -0
  74. package/lib/inventory/cyclonedx20RenderSections.js +499 -0
  75. package/lib/inventory/cyclonedx20Tables.js +594 -0
  76. package/lib/inventory/deps.js +106 -13
  77. package/lib/inventory/dosai.js +236 -1
  78. package/lib/inventory/dosaiParsers.js +3 -6
  79. package/lib/inventory/dotnetRuntime.js +164 -14
  80. package/lib/inventory/ecosystemFormulationParsers.js +979 -0
  81. package/lib/inventory/envcontext.js +132 -38
  82. package/lib/inventory/evidenceUtils.js +2 -1
  83. package/lib/inventory/formulationParsers.js +95 -13
  84. package/lib/inventory/hbom.js +45 -6
  85. package/lib/inventory/hbomLoader.js +166 -0
  86. package/lib/inventory/mcpConfigParser.js +5 -0
  87. package/lib/inventory/occurrenceKey.js +90 -0
  88. package/lib/inventory/pqcMigration.js +426 -0
  89. package/lib/inventory/rustFormulationParser.js +21 -10
  90. package/lib/inventory/source.js +65 -6
  91. package/lib/parsers/huggingfaceManifest.js +9 -1
  92. package/lib/parsers/huggingfaceUtils.js +18 -0
  93. package/lib/parsers/kiroPermissions.js +166 -0
  94. package/lib/server/server.js +36 -34
  95. package/lib/stages/postgen/postgen.js +41 -1
  96. package/lib/stages/postgen/specVersionCompat.js +76 -0
  97. package/lib/validator/bomValidator.js +8 -1
  98. package/lib/validator/complianceEngine.js +30 -3
  99. package/lib/validator/complianceRules.js +1416 -4
  100. package/lib/validator/generated/validate-2.0.mjs +57554 -13851
  101. package/lib/validator/index.js +48 -7
  102. package/lib/validator/reporters/json.js +6 -0
  103. package/package.json +9 -9
  104. package/types/bin/repl.d.ts.map +1 -1
  105. package/types/lib/audit/index.d.ts +6 -2
  106. package/types/lib/audit/index.d.ts.map +1 -1
  107. package/types/lib/cli/bomAssembly.d.ts +16 -0
  108. package/types/lib/cli/bomAssembly.d.ts.map +1 -1
  109. package/types/lib/cli/cliOptions.d.ts +6 -0
  110. package/types/lib/cli/cliOptions.d.ts.map +1 -1
  111. package/types/lib/cli/index.d.ts.map +1 -1
  112. package/types/lib/cli/jsBom.d.ts +2 -1
  113. package/types/lib/cli/jsBom.d.ts.map +1 -1
  114. package/types/lib/cli/jvmBom.d.ts +15 -0
  115. package/types/lib/cli/jvmBom.d.ts.map +1 -1
  116. package/types/lib/cli/managedBom.d.ts.map +1 -1
  117. package/types/lib/cli/nativeBom.d.ts.map +1 -1
  118. package/types/lib/core/boundedFile.d.ts +30 -0
  119. package/types/lib/core/boundedFile.d.ts.map +1 -1
  120. package/types/lib/core/env.d.ts +10 -0
  121. package/types/lib/core/env.d.ts.map +1 -1
  122. package/types/lib/core/fs.d.ts +4 -0
  123. package/types/lib/core/fs.d.ts.map +1 -1
  124. package/types/lib/core/globPatterns.d.ts +70 -0
  125. package/types/lib/core/globPatterns.d.ts.map +1 -0
  126. package/types/lib/core/paths.d.ts +9 -0
  127. package/types/lib/core/paths.d.ts.map +1 -1
  128. package/types/lib/core/processTree.d.ts +16 -5
  129. package/types/lib/core/processTree.d.ts.map +1 -1
  130. package/types/lib/core/projectConfig.d.ts +47 -8
  131. package/types/lib/core/projectConfig.d.ts.map +1 -1
  132. package/types/lib/core/toolRegistry.d.ts.map +1 -1
  133. package/types/lib/ecosystems/golem.d.ts.map +1 -1
  134. package/types/lib/ecosystems/gradleutils.d.ts +248 -8
  135. package/types/lib/ecosystems/gradleutils.d.ts.map +1 -1
  136. package/types/lib/ecosystems/jsEvidence.d.ts +14 -1
  137. package/types/lib/ecosystems/jsEvidence.d.ts.map +1 -1
  138. package/types/lib/ecosystems/kosi.d.ts.map +1 -1
  139. package/types/lib/ecosystems/npmVersionResolution.d.ts +119 -0
  140. package/types/lib/ecosystems/npmVersionResolution.d.ts.map +1 -0
  141. package/types/lib/ecosystems/parsers-python.d.ts.map +1 -1
  142. package/types/lib/ecosystems/parsers-rust.d.ts.map +1 -1
  143. package/types/lib/ecosystems/pythonutils.d.ts +1 -1
  144. package/types/lib/ecosystems/remote/huggingface.d.ts.map +1 -1
  145. package/types/lib/ecosystems/rusi.d.ts.map +1 -1
  146. package/types/lib/ecosystems/scalasem.d.ts +58 -16
  147. package/types/lib/ecosystems/scalasem.d.ts.map +1 -1
  148. package/types/lib/evinser/evinser.d.ts +61 -9
  149. package/types/lib/evinser/evinser.d.ts.map +1 -1
  150. package/types/lib/evinser/scalasem.d.ts.map +1 -1
  151. package/types/lib/helpers/agenticToolutils.d.ts +53 -19
  152. package/types/lib/helpers/agenticToolutils.d.ts.map +1 -1
  153. package/types/lib/helpers/bomSigner.d.ts +20 -3
  154. package/types/lib/helpers/bomSigner.d.ts.map +1 -1
  155. package/types/lib/helpers/jssSigner.d.ts +288 -0
  156. package/types/lib/helpers/jssSigner.d.ts.map +1 -0
  157. package/types/lib/helpers/vsixutils.d.ts +303 -19
  158. package/types/lib/helpers/vsixutils.d.ts.map +1 -1
  159. package/types/lib/inventory/agentBlueprint.d.ts +70 -0
  160. package/types/lib/inventory/agentBlueprint.d.ts.map +1 -0
  161. package/types/lib/inventory/agentToolNames.d.ts +51 -0
  162. package/types/lib/inventory/agentToolNames.d.ts.map +1 -0
  163. package/types/lib/inventory/aiCollector.d.ts.map +1 -1
  164. package/types/lib/inventory/aiInventory.d.ts.map +1 -1
  165. package/types/lib/inventory/aiProviders.d.ts +85 -0
  166. package/types/lib/inventory/aiProviders.d.ts.map +1 -0
  167. package/types/lib/inventory/bomUtils.d.ts.map +1 -1
  168. package/types/lib/inventory/ciParsers/githubActionsLock.d.ts +101 -0
  169. package/types/lib/inventory/ciParsers/githubActionsLock.d.ts.map +1 -0
  170. package/types/lib/inventory/citations.d.ts +5 -0
  171. package/types/lib/inventory/citations.d.ts.map +1 -1
  172. package/types/lib/inventory/communityAiConfigParser.d.ts.map +1 -1
  173. package/types/lib/inventory/cyclonedx20.d.ts +99 -0
  174. package/types/lib/inventory/cyclonedx20.d.ts.map +1 -0
  175. package/types/lib/inventory/cyclonedx20Common.d.ts +102 -0
  176. package/types/lib/inventory/cyclonedx20Common.d.ts.map +1 -0
  177. package/types/lib/inventory/cyclonedx20Derived.d.ts +74 -0
  178. package/types/lib/inventory/cyclonedx20Derived.d.ts.map +1 -0
  179. package/types/lib/inventory/cyclonedx20Parties.d.ts +91 -0
  180. package/types/lib/inventory/cyclonedx20Parties.d.ts.map +1 -0
  181. package/types/lib/inventory/cyclonedx20Read.d.ts +51 -0
  182. package/types/lib/inventory/cyclonedx20Read.d.ts.map +1 -0
  183. package/types/lib/inventory/cyclonedx20ReadCommon.d.ts +69 -0
  184. package/types/lib/inventory/cyclonedx20ReadCommon.d.ts.map +1 -0
  185. package/types/lib/inventory/cyclonedx20ReadComponents.d.ts +77 -0
  186. package/types/lib/inventory/cyclonedx20ReadComponents.d.ts.map +1 -0
  187. package/types/lib/inventory/cyclonedx20ReadContext.d.ts +118 -0
  188. package/types/lib/inventory/cyclonedx20ReadContext.d.ts.map +1 -0
  189. package/types/lib/inventory/cyclonedx20ReadEvidence.d.ts +40 -0
  190. package/types/lib/inventory/cyclonedx20ReadEvidence.d.ts.map +1 -0
  191. package/types/lib/inventory/cyclonedx20ReadSections.d.ts +45 -0
  192. package/types/lib/inventory/cyclonedx20ReadSections.d.ts.map +1 -0
  193. package/types/lib/inventory/cyclonedx20Render.d.ts +53 -0
  194. package/types/lib/inventory/cyclonedx20Render.d.ts.map +1 -0
  195. package/types/lib/inventory/cyclonedx20RenderComponents.d.ts +73 -0
  196. package/types/lib/inventory/cyclonedx20RenderComponents.d.ts.map +1 -0
  197. package/types/lib/inventory/cyclonedx20RenderDefinitions.d.ts +29 -0
  198. package/types/lib/inventory/cyclonedx20RenderDefinitions.d.ts.map +1 -0
  199. package/types/lib/inventory/cyclonedx20RenderEvidence.d.ts +110 -0
  200. package/types/lib/inventory/cyclonedx20RenderEvidence.d.ts.map +1 -0
  201. package/types/lib/inventory/cyclonedx20RenderHardware.d.ts +42 -0
  202. package/types/lib/inventory/cyclonedx20RenderHardware.d.ts.map +1 -0
  203. package/types/lib/inventory/cyclonedx20RenderPatents.d.ts +26 -0
  204. package/types/lib/inventory/cyclonedx20RenderPatents.d.ts.map +1 -0
  205. package/types/lib/inventory/cyclonedx20RenderRefIds.d.ts +55 -0
  206. package/types/lib/inventory/cyclonedx20RenderRefIds.d.ts.map +1 -0
  207. package/types/lib/inventory/cyclonedx20RenderSections.d.ts +45 -0
  208. package/types/lib/inventory/cyclonedx20RenderSections.d.ts.map +1 -0
  209. package/types/lib/inventory/cyclonedx20Tables.d.ts +134 -0
  210. package/types/lib/inventory/cyclonedx20Tables.d.ts.map +1 -0
  211. package/types/lib/inventory/deps.d.ts +35 -2
  212. package/types/lib/inventory/deps.d.ts.map +1 -1
  213. package/types/lib/inventory/dosai.d.ts +19 -0
  214. package/types/lib/inventory/dosai.d.ts.map +1 -1
  215. package/types/lib/inventory/dosaiParsers.d.ts.map +1 -1
  216. package/types/lib/inventory/dotnetRuntime.d.ts +51 -4
  217. package/types/lib/inventory/dotnetRuntime.d.ts.map +1 -1
  218. package/types/lib/inventory/ecosystemFormulationParsers.d.ts +73 -0
  219. package/types/lib/inventory/ecosystemFormulationParsers.d.ts.map +1 -0
  220. package/types/lib/inventory/envcontext.d.ts +22 -6
  221. package/types/lib/inventory/envcontext.d.ts.map +1 -1
  222. package/types/lib/inventory/evidenceUtils.d.ts.map +1 -1
  223. package/types/lib/inventory/formulationParsers.d.ts.map +1 -1
  224. package/types/lib/inventory/hbom.d.ts +11 -0
  225. package/types/lib/inventory/hbom.d.ts.map +1 -1
  226. package/types/lib/inventory/hbomLoader.d.ts +54 -0
  227. package/types/lib/inventory/hbomLoader.d.ts.map +1 -1
  228. package/types/lib/inventory/jvmLocalRepos.d.ts +5 -1
  229. package/types/lib/inventory/jvmLocalRepos.d.ts.map +1 -1
  230. package/types/lib/inventory/mcpConfigParser.d.ts.map +1 -1
  231. package/types/lib/inventory/occurrenceKey.d.ts +52 -0
  232. package/types/lib/inventory/occurrenceKey.d.ts.map +1 -0
  233. package/types/lib/inventory/pqcMigration.d.ts +84 -0
  234. package/types/lib/inventory/pqcMigration.d.ts.map +1 -0
  235. package/types/lib/inventory/rustFormulationParser.d.ts +7 -2
  236. package/types/lib/inventory/rustFormulationParser.d.ts.map +1 -1
  237. package/types/lib/inventory/scalaCoords.d.ts.map +1 -1
  238. package/types/lib/inventory/scalaDedupe.d.ts +43 -0
  239. package/types/lib/inventory/scalaDedupe.d.ts.map +1 -0
  240. package/types/lib/inventory/source.d.ts +15 -0
  241. package/types/lib/inventory/source.d.ts.map +1 -1
  242. package/types/lib/parsers/huggingfaceManifest.d.ts +10 -1
  243. package/types/lib/parsers/huggingfaceManifest.d.ts.map +1 -1
  244. package/types/lib/parsers/huggingfaceUtils.d.ts +12 -0
  245. package/types/lib/parsers/huggingfaceUtils.d.ts.map +1 -1
  246. package/types/lib/parsers/kiroPermissions.d.ts +62 -0
  247. package/types/lib/parsers/kiroPermissions.d.ts.map +1 -0
  248. package/types/lib/parsers/vscodeExtensionId.d.ts +48 -0
  249. package/types/lib/parsers/vscodeExtensionId.d.ts.map +1 -0
  250. package/types/lib/server/server.d.ts.map +1 -1
  251. package/types/lib/stages/postgen/postgen.d.ts +7 -0
  252. package/types/lib/stages/postgen/postgen.d.ts.map +1 -1
  253. package/types/lib/stages/postgen/ruleEngine.d.ts.map +1 -1
  254. package/types/lib/stages/postgen/specVersionCompat.d.ts +25 -0
  255. package/types/lib/stages/postgen/specVersionCompat.d.ts.map +1 -1
  256. package/types/lib/validator/bomValidator.d.ts +5 -1
  257. package/types/lib/validator/bomValidator.d.ts.map +1 -1
  258. package/types/lib/validator/complianceEngine.d.ts +4 -4
  259. package/types/lib/validator/complianceEngine.d.ts.map +1 -1
  260. package/types/lib/validator/complianceRules.d.ts +14 -2
  261. package/types/lib/validator/complianceRules.d.ts.map +1 -1
  262. package/types/lib/validator/index.d.ts +10 -0
  263. package/types/lib/validator/index.d.ts.map +1 -1
  264. package/types/lib/validator/reporters/json.d.ts.map +1 -1
@@ -0,0 +1,53 @@
1
+ /**
2
+ * Render the 1.x-shaped internal model as a CycloneDX 2.0 document: the
3
+ * document sections, reference integrity and the render report. The public
4
+ * entry points are re-exported from cyclonedx20.js.
5
+ */
6
+ /**
7
+ * Render the 1.x-shaped internal model as a CycloneDX 2.0 document and report
8
+ * what could not be carried. Pure: the input is never mutated and the output
9
+ * shares no objects with it. Deterministic: the same input renders to the
10
+ * same JSON.
11
+ *
12
+ * @param {object} internalBom BOM in the 1.x shape
13
+ * @param {{hardwareMapper?: Function, hardwareOptions?: {includeSensitiveIdentifiers?: boolean, identifierPolicy?: string}}} [context]
14
+ * What the render may use besides the model: `hardwareMapper` is the
15
+ * optional toCdx20HardwareComponent of @cdxgen/cdx-hbom and
16
+ * `hardwareOptions` its identifier options (see hbomLoader.js:
17
+ * hardwareRenderContext and cyclonedx20RenderHardware.js). The output
18
+ * depends only on the model and this context.
19
+ * @returns {{bomJson: object, report: {drops: Object<string, number>, rewrites: Object<string, number>, customSchemes: string[], droppedMethods: Array<{reason: string, technique: string}>}}}
20
+ * The 2.0 document, the counts of values the render could not carry
21
+ * (`drops`) and of values it rewrote without losing data (`rewrites`), by
22
+ * label
23
+ */
24
+ export declare function renderCycloneDx20WithReport(internalBom: object, context?: {
25
+ hardwareMapper?: Function;
26
+ hardwareOptions?: {
27
+ includeSensitiveIdentifiers?: boolean;
28
+ identifierPolicy?: string;
29
+ };
30
+ }): {
31
+ bomJson: object;
32
+ report: {
33
+ drops: Record<string, number>;
34
+ rewrites: Record<string, number>;
35
+ customSchemes: string[];
36
+ droppedMethods: Array<{
37
+ reason: string;
38
+ technique: string;
39
+ }>;
40
+ };
41
+ };
42
+ /**
43
+ * Render the 1.x-shaped internal model as a CycloneDX 2.0 document. Pure: the
44
+ * input is never mutated and the output shares no objects with it. What the
45
+ * render could not carry is logged through thoughtLog; use
46
+ * renderCycloneDx20WithReport for the counts.
47
+ *
48
+ * @param {object} internalBom BOM in the 1.x shape
49
+ * @param {object} [context] See renderCycloneDx20WithReport
50
+ * @returns {object} BOM in the 2.0 shape
51
+ */
52
+ export declare function renderCycloneDx20(internalBom: object, context?: object): object;
53
+ //# sourceMappingURL=cyclonedx20Render.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cyclonedx20Render.d.ts","sourceRoot":"","sources":["../../../lib/inventory/cyclonedx20Render.js"],"names":[],"mappings":"AAAA;;;;GAIG;AA+dH;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,2BAA2B,CAAC,WAAW,EAZ5C,MAY4C,EAAE,OAAO,AAX7D,CAEuC,EAF/B;IAAC,cAAc,CAAC,WAAW;IAAC,eAAe,CAAC,EAAE;QAAC,2BAA2B,CAAC,EAAE,OAAO,CAAC;QAAC,gBAAgB,CAAC,EAAE,MAAM,CAAA;KAAC,CAAA;CAWtD,GALxD;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE;QAAC,KAAK,yBAAyB;QAAC,QAAQ,yBAAyB;QAAC,aAAa,EAAE,MAAM,EAAE,CAAC;QAAC,cAAc,EAAE,KAAK,CAAC;YAAC,MAAM,EAAE,MAAM,CAAC;YAAC,SAAS,EAAE,MAAM,CAAA;SAAC,CAAC,CAAA;KAAC,CAAA;CAAC,CA4C7L;AAwKD;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAAC,WAAW,EAJlC,MAIkC,EAAE,OAAO,AAHnD,CACA,EADQ,MAGgD,GAF9C,MAAM,CAIlB"}
@@ -0,0 +1,73 @@
1
+ /**
2
+ * Render-side conversion of 1.x components, services and tools to CycloneDX
3
+ * 2.0 components (#/$defs/cyclonedx-component-2.0/$defs/component).
4
+ */
5
+ /**
6
+ * Convert license choices: 1.x license objects and expressions may carry
7
+ * `bom-ref`, which the 2.0 licenseDeclaration renames to `refId`
8
+ * (#/$defs/cyclonedx-license-2.0/$defs/licenseDeclaration), and a license
9
+ * `text` is an attachment.
10
+ *
11
+ * @param {object[]} licenses 1.x license choices
12
+ * @param {object} stats Render counters
13
+ * @returns {object[]|undefined} 2.0 license choices
14
+ */
15
+ export declare function convertLicenses(licenses: object[], stats: object): object[] | undefined;
16
+ /**
17
+ * Convert a 1.x attachment ({contentType, encoding, content}) to the 2.0
18
+ * attachment (#/$defs/cyclonedx-common-2.0/$defs/attachment, `mediaType`
19
+ * instead of `contentType`, `content` required). A content type that is not
20
+ * a media type the 2.0 pattern accepts is counted and left out.
21
+ *
22
+ * @param {object} attachment 1.x attachment
23
+ * @param {object} stats Render counters
24
+ * @param {string} label Counter label of the attachment's position
25
+ * @returns {object|undefined} 2.0 attachment, or undefined without content
26
+ */
27
+ export declare function convertAttachment(attachment: object, stats: object, label: string): object | undefined;
28
+ /**
29
+ * Convert release notes
30
+ * (#/$defs/cyclonedx-release-notes-2.0/$defs/releaseNotes): the members are
31
+ * the same, but each note's `text` is an attachment and a note requires it.
32
+ *
33
+ * @param {object} releaseNotes 1.x release notes
34
+ * @param {object} stats Render counters
35
+ * @returns {object|undefined} 2.0 release notes
36
+ */
37
+ export declare function convertReleaseNotes(releaseNotes: object, stats: object): object | undefined;
38
+ /** Map a 1.x free-text data classification onto the 2.0 enum or `{name}`. */
39
+ export declare function toDataClassification(classification: any): any;
40
+ /**
41
+ * Convert 1.x dataGovernance ({custodians, stewards, owners} of
42
+ * organization-or-contact entries) into the 2.0 array of parties
43
+ * (#/$defs/cyclonedx-data-2.0/$defs/dataGovernance) with the matching roles.
44
+ */
45
+ export declare function convertGovernance(governance: any, stats: any): any[] | undefined;
46
+ /** Convert 1.x data contents ({attachment, url, properties}). */
47
+ export declare function convertDataContents(contents: any, stats: any): {
48
+ attachment: object;
49
+ } | undefined;
50
+ /**
51
+ * Convert one 1.x component to the 2.0 component shape
52
+ * (#/$defs/cyclonedx-component-2.0/$defs/component). Fields with no 2.0
53
+ * home (`signature`, the deprecated `modified`, …) are counted.
54
+ */
55
+ export declare function convertComponent(component: any, stats: any): any;
56
+ /**
57
+ * Convert one 1.x service into a 2.0 component of type `service`
58
+ * (#/$defs/cyclonedx-component-2.0/$defs/component/properties/type). The
59
+ * provider becomes a party with the `provider` role. `authenticated`,
60
+ * `x-trust-boundary` and `trustZone` have no 2.0 field; they ride as the
61
+ * cdx:service:* properties of CARRIED_SERVICE_PROPERTIES, after the service's
62
+ * own properties, and the reader turns them back into the 1.x fields.
63
+ */
64
+ export declare function convertService(service: any, stats: any): any;
65
+ /**
66
+ * Convert metadata.tools: the 1.x {components, services} object, or the
67
+ * legacy 1.5 array. 2.0 tools hold only `components`
68
+ * (#/$defs/cyclonedx-metadata-2.0/$defs/metadata/properties/tools).
69
+ */
70
+ export declare function convertTools(tools: any, stats: any): {
71
+ components: any[];
72
+ } | undefined;
73
+ //# sourceMappingURL=cyclonedx20RenderComponents.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cyclonedx20RenderComponents.d.ts","sourceRoot":"","sources":["../../../lib/inventory/cyclonedx20RenderComponents.js"],"names":[],"mappings":"AAAA;;;GAGG;AAwEH;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAJ7B,MAAM,EAIuB,EAAE,KAAK,EAHpC,MAGoC,GAFlC,MAAM,EAAE,GAAC,SAAS,CAiC9B;AAMD;;;;;;;;;;GAUG;AACH,wBAAgB,iBAAiB,CAAC,UAAU,EALjC,MAKiC,EAAE,KAAK,EAJxC,MAIwC,EAAE,KAAK,EAH/C,MAG+C,GAF7C,MAAM,GAAC,SAAS,CAkC5B;AAED;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CAAC,YAAY,EAJrC,MAIqC,EAAE,KAAK,EAH5C,MAG4C,GAF1C,MAAM,GAAC,SAAS,CA0B5B;AAED,6EAA6E;AAC7E,wBAAgB,oBAAoB,CAAC,cAAc,KAAA,OAUlD;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,UAAU,KAAA,EAAE,KAAK,KAAA,qBA2BlD;AAED,iEAAiE;AACjE,wBAAgB,mBAAmB,CAAC,QAAQ,KAAA,EAAE,KAAK,KAAA;;cAuBlD;AA0ND;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,SAAS,KAAA,EAAE,KAAK,KAAA,OAyChD;AA8DD;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,OAAO,KAAA,EAAE,KAAK,KAAA,OA4C5C;AAwCD;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,KAAK,KAAA,EAAE,KAAK,KAAA;;cAmBxC"}
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Render-side conversion of the 1.x definitions standards and the root
3
+ * `declarations` (#/$defs/cyclonedx-standard-2.0 and
4
+ * #/$defs/cyclonedx-declaration-2.0). Their members keep their names; the
5
+ * 1.x `bom-ref` becomes `refId`, organizations and contacts take the 2.0
6
+ * common shapes, attachments the 2.0 attachment, and a 1.x JSF `signature`
7
+ * is counted and left out (see countSignatureDrop).
8
+ */
9
+ /**
10
+ * Convert 1.x definitions.standards
11
+ * (#/$defs/cyclonedx-standard-2.0/$defs/standards). Requirement `parent`
12
+ * and level `requirements` are refLinkType values; the refIds keep the
13
+ * bom-ref values, so they still resolve.
14
+ *
15
+ * @param {object[]} standards 1.x standards
16
+ * @param {object} stats Render counters
17
+ * @returns {object[]|undefined} 2.0 standards
18
+ */
19
+ export declare function convertStandards(standards: object[], stats: object): object[] | undefined;
20
+ /**
21
+ * Render the root `declarations`
22
+ * (#/$defs/cyclonedx-declaration-2.0/$defs/declarations).
23
+ *
24
+ * @param {object} declarations 1.x declarations
25
+ * @param {object} stats Render counters
26
+ * @returns {object|undefined} 2.0 declarations
27
+ */
28
+ export declare function renderDeclarations(declarations: object, stats: object): object | undefined;
29
+ //# sourceMappingURL=cyclonedx20RenderDefinitions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cyclonedx20RenderDefinitions.d.ts","sourceRoot":"","sources":["../../../lib/inventory/cyclonedx20RenderDefinitions.js"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AA2FH;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAAC,SAAS,EAJ/B,MAAM,EAIyB,EAAE,KAAK,EAHtC,MAGsC,GAFpC,MAAM,EAAE,GAAC,SAAS,CA6C9B;AA8GD;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,YAAY,EAJpC,MAIoC,EAAE,KAAK,EAH3C,MAG2C,GAFzC,MAAM,GAAC,SAAS,CAyI5B"}
@@ -0,0 +1,110 @@
1
+ /**
2
+ * Render-side conversion of 1.x component evidence and cryptoProperties to
3
+ * the CycloneDX 2.0 shapes (#/$defs/cyclonedx-component-2.0/$defs/componentEvidence,
4
+ * #/$defs/cyclonedx-cryptography-2.0/$defs/cryptoProperties).
5
+ */
6
+ /**
7
+ * The refId prefix of the party derived for a tool other than cdxgen. Any
8
+ * refId that starts with it is a valid refIdType
9
+ * (#/$defs/cyclonedx-common-2.0/$defs/refIdType: non-empty and not starting
10
+ * with the BOM-Link intro `urn:cdx:`), whatever the tool's own refId is, so
11
+ * the tool refId is appended unchanged and the party refId stays readable and
12
+ * deterministic.
13
+ */
14
+ export declare const TOOL_PARTY_REF_ID_PREFIX = "party-tool-";
15
+ /**
16
+ * What the claims cdxgen writes at 2.0 are attributed with (#4591). cdxgen
17
+ * claims only analysis it did:
18
+ *
19
+ * - `toolRefId` is the refId of the cdxgen tool component, present only when
20
+ * the BOM's `metadata.tools` lists cdxgen with a `bom-ref` (the tool named
21
+ * "cdxgen", the same match findCdxgenToolBomRef in
22
+ * lib/inventory/citations.js makes). Identity evidence carries cdxgen's
23
+ * assertion, its tool and method results only when this is set.
24
+ * - `assertingTool` is set only without `toolRefId`: the first other tool
25
+ * component with a `bom-ref` (`{refId, toolRefId, label?}`), whose party
26
+ * asserts the component identifiers (`identifiers[].party` is required).
27
+ * With neither, cdxgen, as the converting tool, asserts the identifiers it
28
+ * wrote.
29
+ * - `timestamp` is the BOM timestamp when it has one.
30
+ *
31
+ * Nothing is invented: absent members stay absent.
32
+ *
33
+ * @param {object} bom BOM in the 1.x shape (only `metadata` is read)
34
+ * @returns {{toolRefId?: string, assertingTool?: {refId: string, toolRefId: string, label?: string}, timestamp?: string}} Claim context
35
+ */
36
+ export declare function identityClaimContext(bom: object): {
37
+ toolRefId?: string;
38
+ assertingTool?: {
39
+ refId: string;
40
+ toolRefId: string;
41
+ label?: string;
42
+ };
43
+ timestamp?: string;
44
+ };
45
+ /**
46
+ * The refId of the party asserting the component identifiers: the cdxgen
47
+ * party when cdxgen is the listed tool or no tool is listed, else the party
48
+ * of the first other listed tool (see identityClaimContext).
49
+ *
50
+ * @param {object} claims Claim context from identityClaimContext
51
+ * @returns {string} Party refId
52
+ */
53
+ export declare function identifierPartyRefId(claims: object): string;
54
+ /**
55
+ * The parties the renderer derives from the claim context, in the order it
56
+ * appends them: the cdxgen party, then the asserting tool's party when there
57
+ * is one. Each is a party (#/$defs/cyclonedx-party-2.0/$defs/party) with the
58
+ * `asserter` role and a system identity
59
+ * (#/$defs/cyclonedx-party-2.0/$defs/system, kind `automation`) whose `ref`
60
+ * names the tool component only when that refId is declared. The renderer
61
+ * declares one only when the document references it; the reader drops one
62
+ * that matches exactly, since the render derives it again.
63
+ *
64
+ * @param {object} claims Claim context from identityClaimContext
65
+ * @param {Set<string>} declared refIds declared in the document
66
+ * @returns {object[]} Party declarations
67
+ */
68
+ export declare function derivedPartyDeclarations(claims: object, declared: Set<string>): object[];
69
+ /**
70
+ * Convert one 1.x identity entry to componentIdentityEvidence
71
+ * (#/$defs/cyclonedx-component-2.0/$defs/componentIdentityEvidence). When
72
+ * cdxgen is the listed tool (#4591), the entry is cdxgen's attributed claim:
73
+ * `tools` names the helper recorded on the entry or, failing that, the cdxgen
74
+ * tool; `assertion` credits the cdxgen party as asserter
75
+ * (#/$defs/cyclonedx-evidence-2.0/$defs/assertion); and a method with a
76
+ * matched value has the result `detected`. For another tool's BOM cdxgen did
77
+ * not do that analysis, so none of these is added; the entry's own `tools`
78
+ * are kept. `timestamp` is the BOM's own when it has one.
79
+ *
80
+ * @param {object} entry 1.x identity evidence entry
81
+ * @param {object} stats Render counters from createRenderStats
82
+ * @returns {object|undefined} The 2.0 entry, or undefined without a field
83
+ */
84
+ export declare function convertIdentityEntry(entry: object, stats: object): object | undefined;
85
+ /**
86
+ * Convert component evidence
87
+ * (#/$defs/cyclonedx-component-2.0/$defs/componentEvidence). The 1.x
88
+ * `callstack` object becomes the `callStacks` array; identity `field` becomes
89
+ * `scheme`. Every nested object is cloned, so nothing is shared with the
90
+ * input.
91
+ */
92
+ export declare function convertComponentEvidence(evidence: any, stats: any): {
93
+ identity: any[];
94
+ occurrences: any[];
95
+ callStacks: {
96
+ frames: any[];
97
+ }[];
98
+ licenses: any[];
99
+ copyright: any[];
100
+ } | undefined;
101
+ /**
102
+ * Convert cryptoProperties
103
+ * (#/$defs/cyclonedx-cryptography-2.0/$defs/cryptoProperties, required
104
+ * `[assetType]`): drop the deprecated free-text `curve` (2.0 keeps only
105
+ * `ellipticCurve`) and the algorithm families and protocol types the pinned
106
+ * 2.0 enums do not list, move the deprecated 1.x reference members into
107
+ * `relatedCryptographicAssets`, and count every member 2.0 has no field for.
108
+ */
109
+ export declare function convertCryptoProperties(cryptoProperties: any, stats: any): any;
110
+ //# sourceMappingURL=cyclonedx20RenderEvidence.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cyclonedx20RenderEvidence.d.ts","sourceRoot":"","sources":["../../../lib/inventory/cyclonedx20RenderEvidence.js"],"names":[],"mappings":"AAAA;;;;GAIG;AA6FH;;;;;;;GAOG;AACH,eAAO,MAAM,wBAAwB,gBAAgB,CAAC;AAEtD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAH7B,MAG6B,GAF3B;IAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,aAAa,CAAC,EAAE;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAC,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAC,CAgCxH;AAED;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAHhC,MAGgC,GAF9B,MAAM,CAIlB;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,wBAAwB,CAAC,MAAM,EAJpC,MAIoC,EAAE,QAAQ,EAH9C,GAAG,CAAC,MAAM,CAGoC,GAF5C,MAAM,EAAE,CA0BpB;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAJ/B,MAI+B,EAAE,KAAK,EAHtC,MAGsC,GAFpC,MAAM,GAAC,SAAS,CA6C5B;AAoID;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CAAC,QAAQ,KAAA,EAAE,KAAK,KAAA;;;;;;;;cAkDvD;AAiPD;;;;;;;GAOG;AACH,wBAAgB,uBAAuB,CAAC,gBAAgB,KAAA,EAAE,KAAK,KAAA,OAiB9D"}
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Hardware components at 2.0 (cdxgen/cdxgen#4755). What each `cdx:hbom:*`
3
+ * property means in the 2.0 draft is owned by @cdxgen/cdx-hbom, whose
4
+ * optional `./cdx20` export provides `toCdx20HardwareComponent(component,
5
+ * {partyRefId, includeSensitiveIdentifiers, identifierPolicy})`. The caller
6
+ * loads it (lib/inventory/hbomLoader.js: hardwareRenderContext) and passes
7
+ * it, with those options, to renderCycloneDx20 in the render context, so the
8
+ * render stays a pure function of its arguments.
9
+ *
10
+ * The renderer converts the component as usual and then takes only these
11
+ * members from the mapper's result, each checked against the pinned schema:
12
+ *
13
+ * - `identifiers`: only groups asserted by the party the renderer passed
14
+ * (the one its own identifiers use, which it declares when referenced).
15
+ * Their identities are appended to that party's group, or added as a new
16
+ * group, so a purl identity is never replaced. Only identities with a
17
+ * scheme from the identityScheme enum (or a custom `{name}`) and a
18
+ * non-empty value are taken.
19
+ * - `classification` (#/$defs/cyclonedx-physical-2.0/$defs/classification):
20
+ * `category`, `subcategory`, and `codes` that are taxonomyCode objects
21
+ * (`{standard, value}`); a bare string code is dropped and counted.
22
+ * - a manufacturer party, when the generic conversion produced none.
23
+ *
24
+ * Every `cdx:hbom:*` property stays: the hbom audit rules read them.
25
+ */
26
+ /** True when the 1.x component carries at least one cdx:hbom:* property. */
27
+ export declare function isHardwareComponent(component: any): any;
28
+ /**
29
+ * Add the hardware mapper's 2.0 members to a converted hardware component.
30
+ * Without a mapper, or for a component without cdx:hbom:* properties, the
31
+ * converted component is returned unchanged. The mapper gets a clone of the
32
+ * 1.x component, the asserting party refId the generic identifiers use (so
33
+ * its identifiers resolve to the party the renderer declares) and the
34
+ * identifier options of the render context (`stats.hardwareOptions`).
35
+ *
36
+ * @param {object} component The 1.x component
37
+ * @param {object} converted Its generic 2.0 conversion, extended in place
38
+ * @param {object} stats Render counters with the optional `hardwareMapper`
39
+ * @returns {object} The converted component
40
+ */
41
+ export declare function applyHardwareMapping(component: object, converted: object, stats: object): object;
42
+ //# sourceMappingURL=cyclonedx20RenderHardware.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cyclonedx20RenderHardware.d.ts","sourceRoot":"","sources":["../../../lib/inventory/cyclonedx20RenderHardware.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAeH,4EAA4E;AAC5E,wBAAgB,mBAAmB,CAAC,SAAS,KAAA,OAQ5C;AAqHD;;;;;;;;;;;;GAYG;AACH,wBAAgB,oBAAoB,CAAC,SAAS,EALnC,MAKmC,EAAE,SAAS,EAJ9C,MAI8C,EAAE,KAAK,EAHrD,MAGqD,GAFnD,MAAM,CA0BlB"}
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Render-side conversion of 1.x patents, patent families and patent
3
+ * assertions (#/$defs/cyclonedx-patent-2.0). The members are the same; the
4
+ * 1.x `bom-ref` becomes `refId`, and organizations and contacts take the
5
+ * 2.0 common shapes.
6
+ */
7
+ /**
8
+ * Convert 1.x definitions.patents: patents and patent families.
9
+ *
10
+ * @param {object[]} patents 1.x patents and patent families
11
+ * @param {object} stats Render counters
12
+ * @returns {object[]|undefined} 2.0 patents
13
+ */
14
+ export declare function convertPatents(patents: object[], stats: object): object[] | undefined;
15
+ /**
16
+ * Convert 1.x patentAssertions
17
+ * (#/$defs/cyclonedx-patent-2.0/$defs/patentAssertions): the asserter is an
18
+ * organization, a contact or a refLinkType string.
19
+ *
20
+ * @param {object[]} assertions 1.x patent assertions
21
+ * @param {object} stats Render counters
22
+ * @returns {object[]|undefined} 2.0 patent assertions, or undefined when
23
+ * none is left
24
+ */
25
+ export declare function convertPatentAssertions(assertions: object[], stats: object): object[] | undefined;
26
+ //# sourceMappingURL=cyclonedx20RenderPatents.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cyclonedx20RenderPatents.d.ts","sourceRoot":"","sources":["../../../lib/inventory/cyclonedx20RenderPatents.js"],"names":[],"mappings":"AAAA;;;;;GAKG;AA4EH;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAJ3B,MAAM,EAIqB,EAAE,KAAK,EAHlC,MAGkC,GAFhC,MAAM,EAAE,GAAC,SAAS,CA6C9B;AAED;;;;;;;;;GASG;AACH,wBAAgB,uBAAuB,CAAC,UAAU,EALvC,MAAM,EAKiC,EAAE,KAAK,EAJ9C,MAI8C,GAH5C,MAAM,EAAE,GAAC,SAAS,CAiC9B"}
@@ -0,0 +1,55 @@
1
+ /**
2
+ * Reference integrity of a rendered CycloneDX 2.0 document: every refId is
3
+ * unique (the 2.0 refIdType rule "Every `refId` shall be unique within the
4
+ * document", which JSON Schema cannot check), and dependency and
5
+ * vulnerability references resolve to a declared refId or a BOM-Link.
6
+ */
7
+ /**
8
+ * Make every refId unique. The roots are walked in order, so the earliest
9
+ * root keeps a repeated refId; pass the inventories before metadata so the
10
+ * subject of a self-scan keeps its members when it repeats the refId of the
11
+ * tool. A later declaration with an already declared refId becomes:
12
+ *
13
+ * - a componentReference or partyReference `{ref}` when it sits in a slot
14
+ * that accepts one and an earlier declaration of the same kind already
15
+ * holds every member it has (nothing is lost);
16
+ * - nothing, in the definitions registry, under the same condition (counted
17
+ * as already declared), and also when an inventory declares the refId
18
+ * with other members (the members only the registry entry had are
19
+ * counted as dropped);
20
+ * - unchanged, when neither it nor an earlier declaration sits in a
21
+ * component or party slot (counted);
22
+ * - otherwise the same object under a new refId `<refId>-dup-<n>`, so no data
23
+ * is lost and references to the refId keep resolving to the first
24
+ * declaration.
25
+ *
26
+ * @param {Array<{section: string, value: *}>} roots Rendered sections, the
27
+ * definitions root marked with `section: "definitions"`
28
+ * @param {object} stats Render counters
29
+ */
30
+ export declare function dedupeRefIds(roots: Array<{
31
+ section: string;
32
+ value: any;
33
+ }>, stats: object): void;
34
+ /**
35
+ * Keep only dependency references that resolve: an entry whose `ref` names
36
+ * nothing declared is dropped, and so is each such `dependsOn` and
37
+ * `provides` member. An emptied `dependsOn` stays, since an empty list says
38
+ * the component has no dependencies.
39
+ *
40
+ * @param {object[]|undefined} dependencies Rendered dependencies
41
+ * @param {Set<string>} declared Every declared refId
42
+ * @param {object} stats Render counters
43
+ * @returns {object[]|undefined} The dependencies left, or undefined
44
+ */
45
+ export declare function resolveDependencyRefs(dependencies: object[] | undefined, declared: Set<string>, stats: object): object[] | undefined;
46
+ /**
47
+ * Drop vulnerability `affects` entries whose `ref` resolves to nothing, and
48
+ * an `affects` list left empty.
49
+ *
50
+ * @param {object[]|undefined} vulnerabilities Rendered vulnerabilities
51
+ * @param {Set<string>} declared Every declared refId
52
+ * @param {object} stats Render counters
53
+ */
54
+ export declare function resolveAffectsRefs(vulnerabilities: object[] | undefined, declared: Set<string>, stats: object): void;
55
+ //# sourceMappingURL=cyclonedx20RenderRefIds.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cyclonedx20RenderRefIds.d.ts","sourceRoot":"","sources":["../../../lib/inventory/cyclonedx20RenderRefIds.js"],"names":[],"mappings":"AAAA;;;;;GAKG;AAqGH;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAJvB,KAAK,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,GAAC,CAAA;CAAC,CAIV,EAAE,KAAK,EAF9B,MAE8B,QA2GxC;AAKD;;;;;;;;;;GAUG;AACH,wBAAgB,qBAAqB,CAAC,YAAY,EALvC,MAAM,EAAE,GAAC,SAK8B,EAAE,QAAQ,EAJjD,GAAG,CAAC,MAAM,CAIuC,EAAE,KAAK,EAHxD,MAGwD,GAFtD,MAAM,EAAE,GAAC,SAAS,CA6B9B;AAED;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,eAAe,EAJvC,MAAM,EAAE,GAAC,SAI8B,EAAE,QAAQ,EAHjD,GAAG,CAAC,MAAM,CAGuC,EAAE,KAAK,EAFxD,MAEwD,QAwBlE"}
@@ -0,0 +1,45 @@
1
+ /**
2
+ * Render the CycloneDX 2.0 sections that sit beside the inventory:
3
+ * compositions, annotations, citations, vulnerabilities and formulation.
4
+ * Each converter restores an entry readCycloneDx20 kept as a shadow while
5
+ * the entry is unchanged.
6
+ */
7
+ /**
8
+ * Render compositions (#/$defs/cyclonedx-composition-2.0/$defs/composition,
9
+ * required `[kind, aggregate, targets]`). The composition's own 1.x
10
+ * `bom-ref` (cdxgen sets it to the subject's bom-ref) is not carried, so it
11
+ * cannot collide with the subject's refId.
12
+ */
13
+ export declare function renderCompositions(compositions: any, inventory: any, carried: any, stats: any): any[] | undefined;
14
+ /**
15
+ * Render annotations (#/$defs/cyclonedx-annotation-2.0/$defs/annotation,
16
+ * required `[subjects, annotator, timestamp, text]`). Subjects are checked
17
+ * against the declared refIds once the whole document exists
18
+ * (see resolveAnnotationSubjects).
19
+ */
20
+ export declare function renderAnnotations(annotations: any, stats: any): any[] | undefined;
21
+ /**
22
+ * Render citations (#/$defs/cyclonedx-citation-2.0/$defs/citation).
23
+ * `attributedTo` is a refLinkType, so it names a declared object's refId; the
24
+ * cdxgen tool's bom-ref becomes exactly that refId. A citation may carry
25
+ * `attributedTo`, `process` or both, so only the ref rename and the
26
+ * expression rewrite are targeted.
27
+ */
28
+ export declare function renderCitations(citations: any, usesInventory: any, stats: any): any[] | undefined;
29
+ /**
30
+ * Render vulnerabilities: `bom-ref` → `refId`, `cwes` → `weaknesses`, the
31
+ * tools object, credits as 2.0 organizations and contacts and the proof of
32
+ * concept's attachments. Members 2.0 has no field for are counted; `affects`
33
+ * references are resolved once every refId is known (resolveAffectsRefs).
34
+ */
35
+ export declare function renderVulnerabilities(vulnerabilities: any, stats: any): any[] | undefined;
36
+ /**
37
+ * formulation → workflows/tasks/triggers with refId renames. The 2.0 formula
38
+ * allows only refId, properties and workflows
39
+ * (#/$defs/cyclonedx-formulation-2.0/$defs/formula), so the 1.x
40
+ * formula.components move to definitions.components (upstream's
41
+ * valid-formulation-2.0.json declares them there too) and are collected in
42
+ * `stats.formulaComponents`.
43
+ */
44
+ export declare function convertFormulation(formulation: any, stats: any): any;
45
+ //# sourceMappingURL=cyclonedx20RenderSections.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cyclonedx20RenderSections.d.ts","sourceRoot":"","sources":["../../../lib/inventory/cyclonedx20RenderSections.js"],"names":[],"mappings":"AAAA;;;;;GAKG;AAsEH;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,YAAY,KAAA,EAAE,SAAS,KAAA,EAAE,OAAO,KAAA,EAAE,KAAK,KAAA,qBAwCzE;AAwBD;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,WAAW,KAAA,EAAE,KAAK,KAAA,qBAiCnD;AA4BD;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,SAAS,KAAA,EAAE,aAAa,KAAA,EAAE,KAAK,KAAA,qBAqB9D;AAkHD;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,eAAe,KAAA,EAAE,KAAK,KAAA,qBA+C3D;AAgBD;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,WAAW,KAAA,EAAE,KAAK,KAAA,OA8DpD"}
@@ -0,0 +1,134 @@
1
+ /**
2
+ * Frozen lookup tables for the CycloneDX 2.0 renderer and reader: schema enums,
3
+ * the aggregate spelling table, the pinned 2.0 cryptography enums and the field
4
+ * lists that say which 1.x members each converter carries. Every value is
5
+ * quoted from the pinned draft schema
6
+ * (data/cyclonedx-2.0-bundled.schema.json, CycloneDX/specification 2.0-dev at
7
+ * ea8c3605829d1da13339a0790b6da73548e42a6b).
8
+ */
9
+ /**
10
+ * Internal key that carries 2.0-only sections (risks, blueprints, threats,
11
+ * controls, perspectives, profiles, declarations and definitions.parties)
12
+ * through the 1.x-shaped model so a read-then-render round trip preserves
13
+ * them. Never serialized: renderCycloneDx20 re-emits them and
14
+ * applySpecVersionCompatibility strips the key for 1.x output.
15
+ */
16
+ export declare const CDX20_INTERNAL_SECTIONS_KEY = "cdx20Sections";
17
+ /**
18
+ * The formula property that names, as a JSON array of refIds, the
19
+ * definitions components of a subject-less 2.0 document that belong to the
20
+ * formula (2.0 has no formula member for them).
21
+ */
22
+ export declare const FORMULA_COMPONENT_REFS_PROPERTY = "cdx:formulation:componentRefs";
23
+ /** refId of the cdxgen party declared in definitions.parties. */
24
+ export declare const CDXGEN_PARTY_REF_ID = "party-cdxgen";
25
+ /**
26
+ * Message shown when a CycloneDX 2.0 document would be uploaded to
27
+ * Dependency-Track, which ingests CycloneDX 1.x only.
28
+ */
29
+ export declare const DEPENDENCY_TRACK_CDX20_ERROR = "Dependency-Track does not ingest the CycloneDX 2.0 draft, so a 2.0 document cannot be uploaded with --server-url. Generate with --spec-version 1.7 to upload to Dependency-Track.";
30
+ /** identityScheme enum (#/$defs/cyclonedx-component-2.0/$defs/identityScheme). */
31
+ export declare const IDENTITY_SCHEME_ENUM: Set<string>;
32
+ export declare const FORBIDDEN_IDENTITY_TECHNIQUES: Set<string>;
33
+ export declare const ANALYSIS_TECHNIQUE_ENUM: Set<string>;
34
+ export declare const AGGREGATE_1X_TO_20: Readonly<{
35
+ complete: "complete";
36
+ incomplete: "incomplete";
37
+ incomplete_first_party_only: "incomplete-first-party-only";
38
+ incomplete_first_party_proprietary_only: "incomplete-first-party-proprietary-only";
39
+ incomplete_first_party_opensource_only: "incomplete-first-party-opensource-only";
40
+ incomplete_third_party_only: "incomplete-third-party-only";
41
+ incomplete_third_party_proprietary_only: "incomplete-third-party-proprietary-only";
42
+ incomplete_third_party_opensource_only: "incomplete-third-party-opensource-only";
43
+ unknown: "unknown";
44
+ not_specified: "not-specified";
45
+ }>;
46
+ /** The inverse of AGGREGATE_1X_TO_20. */
47
+ export declare const AGGREGATE_20_TO_1X: Readonly<{
48
+ [k: string]: string;
49
+ }>;
50
+ /** 2.0 algorithmFamily values (pinned 2.0 cryptography defs). */
51
+ export declare const ALGORITHM_FAMILY_ENUM: Readonly<Set<any>>;
52
+ /** 2.0 protocolProperties.type values (pinned 2.0 cryptography defs). */
53
+ export declare const PROTOCOL_FAMILY_ENUM: Readonly<Set<any>>;
54
+ export declare const COMPONENT_DATA_TYPE_ENUM: Set<string>;
55
+ export declare const DATA_CLASSIFICATION_ENUM: Set<string>;
56
+ export declare const POSTAL_ADDRESS_FIELDS: string[];
57
+ export declare const COMPONENT_ENTRY_ARRAY_KEYS: Set<string>;
58
+ export declare const LICENSE_EVIDENCE_DETAIL_FIELDS: string[];
59
+ /** 1.x componentData members the renderer handles. */
60
+ export declare const COMPONENT_DATA_FIELDS: Set<string>;
61
+ export declare const COMPONENT_COPY_FIELDS: string[];
62
+ /** 1.x component members the renderer handles; the rest are counted. */
63
+ export declare const COMPONENT_HANDLED_FIELDS: Set<string>;
64
+ export declare const SERVICE_COPY_FIELDS: string[];
65
+ /**
66
+ * 1.x service members without a 2.0 field, carried at 2.0 as the documented
67
+ * cdx:service:* properties (docs/CUSTOM_PROPERTIES.md) so the mcp-server
68
+ * audit rules keep firing on a document read back from 2.0. Each entry is
69
+ * [1.x field, property name, value kind]; the renderer appends them in this
70
+ * order and the reader turns them back into the 1.x fields.
71
+ */
72
+ export declare const CARRIED_SERVICE_PROPERTIES: readonly (readonly string[])[];
73
+ /** 1.x service members the renderer handles; the rest are counted. */
74
+ export declare const SERVICE_HANDLED_FIELDS: Set<string>;
75
+ /** 1.x algorithmFamily values (cryptography-defs algorithmFamiliesEnum). */
76
+ export declare const ALGORITHM_FAMILY_1X: Readonly<Set<any>>;
77
+ /** 1.x ellipticCurve values (cryptography-defs ellipticCurvesEnum). */
78
+ export declare const ELLIPTIC_CURVE_1X: Readonly<Set<any>>;
79
+ /** 1.7 externalReference.type values. */
80
+ export declare const EXTERNAL_REFERENCE_TYPES_1X: Readonly<Set<string>>;
81
+ /** 1.7 component.type values. */
82
+ export declare const COMPONENT_TYPES_1X: Readonly<Set<string>>;
83
+ /** 1.7 componentIdentityEvidence.field values. */
84
+ export declare const IDENTITY_FIELDS_1X: Readonly<Set<string>>;
85
+ /** 1.7 identity-evidence method techniques. */
86
+ export declare const IDENTITY_TECHNIQUES_1X: Readonly<Set<string>>;
87
+ /** 1.7 vulnerability rating `method` values (scoreMethod). */
88
+ export declare const SCORE_METHODS_1X: Readonly<Set<string>>;
89
+ /**
90
+ * 1.7 cryptoProperties algorithmProperties enums, by member name. Members
91
+ * whose 2.0 value is a list in 1.7 too are checked entry by entry.
92
+ */
93
+ export declare const ALGORITHM_PROPERTY_ENUMS_1X: Readonly<{
94
+ primitive: Readonly<Set<string>>;
95
+ executionEnvironment: Readonly<Set<string>>;
96
+ implementationPlatform: Readonly<Set<string>>;
97
+ mode: Readonly<Set<string>>;
98
+ padding: Readonly<Set<string>>;
99
+ cryptoFunctions: Readonly<Set<string>>;
100
+ }>;
101
+ /** 1.7 protocolProperties.type values. */
102
+ export declare const PROTOCOL_TYPES_1X: Readonly<Set<string>>;
103
+ /**
104
+ * Party roles (#/$defs/cyclonedx-party-2.0/$defs/preDefinedRole) the 1.x
105
+ * component and service fields can hold, with the 1.x field.
106
+ */
107
+ export declare const PARTY_ROLE_FIELDS_1X: Readonly<{
108
+ supplier: "supplier";
109
+ manufacturer: "manufacturer";
110
+ author: "authors";
111
+ publisher: "publisher";
112
+ provider: "provider";
113
+ }>;
114
+ /**
115
+ * Identity schemes (#/$defs/cyclonedx-component-2.0/$defs/identityScheme) the
116
+ * 1.x identifier fields hold, with the 1.x field. `omniborid` and `swhid` are
117
+ * lists in 1.x; the others hold one value.
118
+ */
119
+ export declare const IDENTITY_SCHEME_FIELDS_1X: Readonly<{
120
+ purl: "purl";
121
+ cpe: "cpe";
122
+ swid: "swid";
123
+ omniborid: "omniborId";
124
+ swhid: "swhid";
125
+ }>;
126
+ /** 2.0 identity-evidence scheme → 1.x field, for the predefined schemes. */
127
+ export declare const IDENTITY_EVIDENCE_SCHEME_TO_FIELD: Readonly<{
128
+ purl: "purl";
129
+ cpe: "cpe";
130
+ swid: "swid";
131
+ swhid: "swhid";
132
+ omniborid: "omniborId";
133
+ }>;
134
+ //# sourceMappingURL=cyclonedx20Tables.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cyclonedx20Tables.d.ts","sourceRoot":"","sources":["../../../lib/inventory/cyclonedx20Tables.js"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAOH;;;;;;GAMG;AACH,eAAO,MAAM,2BAA2B,kBAAkB,CAAC;AAE3D;;;;GAIG;AACH,eAAO,MAAM,+BAA+B,kCAAkC,CAAC;AAE/E,iEAAiE;AACjE,eAAO,MAAM,mBAAmB,iBAAiB,CAAC;AAElD;;;GAGG;AACH,eAAO,MAAM,4BAA4B,sLAC4I,CAAC;AAEtL,kFAAkF;AAClF,eAAO,MAAM,oBAAoB,aA0B/B,CAAC;AAKH,eAAO,MAAM,6BAA6B,aAWxC,CAAC;AAGH,eAAO,MAAM,uBAAuB,aA6BlC,CAAC;AAKH,eAAO,MAAM,kBAAkB;;;;;;;;;;;EAe7B,CAAC;AAEH,yCAAyC;AACzC,eAAO,MAAM,kBAAkB;;EAI9B,CAAC;AAgBF,iEAAiE;AACjE,eAAO,MAAM,qBAAqB,oBAEjC,CAAC;AAEF,yEAAyE;AACzE,eAAO,MAAM,oBAAoB,oBAEhC,CAAC;AAGF,eAAO,MAAM,wBAAwB,aAMnC,CAAC;AAIH,eAAO,MAAM,wBAAwB,aAMnC,CAAC;AAIH,eAAO,MAAM,qBAAqB,UAOjC,CAAC;AAKF,eAAO,MAAM,0BAA0B,aAKrC,CAAC;AAIH,eAAO,MAAM,8BAA8B,UAQ1C,CAAC;AAEF,sDAAsD;AACtD,eAAO,MAAM,qBAAqB,aAShC,CAAC;AAIH,eAAO,MAAM,qBAAqB,UAoBjC,CAAC;AAEF,wEAAwE;AACxE,eAAO,MAAM,wBAAwB,aAuBnC,CAAC;AAGH,eAAO,MAAM,mBAAmB,UAY/B,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,0BAA0B,gCAIrC,CAAC;AAEH,sEAAsE;AACtE,eAAO,MAAM,sBAAsB,aAQjC,CAAC;AAgBH,4EAA4E;AAC5E,eAAO,MAAM,mBAAmB,oBAE/B,CAAC;AAEF,uEAAuE;AACvE,eAAO,MAAM,iBAAiB,oBAE7B,CAAC;AAEF,yCAAyC;AACzC,eAAO,MAAM,2BAA2B,uBAkDvC,CAAC;AAEF,iCAAiC;AACjC,eAAO,MAAM,kBAAkB,uBAgB9B,CAAC;AAEF,kDAAkD;AAClD,eAAO,MAAM,kBAAkB,uBAY9B,CAAC;AAEF,+CAA+C;AAC/C,eAAO,MAAM,sBAAsB,uBAalC,CAAC;AAEF,8DAA8D;AAC9D,eAAO,MAAM,gBAAgB,uBAE5B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,2BAA2B;;;;;;;EAkFtC,CAAC;AAEH,0CAA0C;AAC1C,eAAO,MAAM,iBAAiB,uBAiB7B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,oBAAoB;;;;;;EAM/B,CAAC;AAEH;;;;GAIG;AACH,eAAO,MAAM,yBAAyB;;;;;;EAMpC,CAAC;AAEH,4EAA4E;AAC5E,eAAO,MAAM,iCAAiC;;;;;;EAM5C,CAAC"}