@cdxgen/cdxgen 13.1.0 → 13.3.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 (283) hide show
  1. package/README.md +32 -15
  2. package/bin/cdxgen.js +243 -122
  3. package/bin/evinse.js +7 -0
  4. package/bin/sign.js +88 -14
  5. package/bin/tracebom.js +64 -4
  6. package/bin/validate.js +29 -7
  7. package/bin/verify.js +79 -39
  8. package/data/crypto-oid.json +88 -12
  9. package/data/remediations.json +47 -0
  10. package/data/rules/ai-bom.yaml +78 -0
  11. package/data/rules/cargo-rust.yaml +132 -0
  12. package/data/rules/mcp-servers.yaml +122 -0
  13. package/lib/audit/targets.js +6 -1
  14. package/lib/cli/bomAssembly.js +117 -15
  15. package/lib/cli/cliOptions.js +93 -1
  16. package/lib/cli/index.js +235 -5
  17. package/lib/cli/jsBom.js +108 -26
  18. package/lib/cli/jvmBom.js +68 -12
  19. package/lib/cli/managedBom.js +264 -41
  20. package/lib/cli/nativeBom.js +923 -15
  21. package/lib/core/activity.js +120 -2
  22. package/lib/core/env.js +44 -7
  23. package/lib/core/fs.js +174 -6
  24. package/lib/core/metadataProperties.js +97 -0
  25. package/lib/core/projectConfig.js +31 -4
  26. package/lib/core/userAgent.js +151 -0
  27. package/lib/ecosystems/bunutils.js +269 -101
  28. package/lib/ecosystems/cargoCache.js +364 -0
  29. package/lib/ecosystems/caxa.js +447 -7
  30. package/lib/ecosystems/cmakeResolver.js +66 -0
  31. package/lib/ecosystems/cppEvidence.js +104 -33
  32. package/lib/ecosystems/ecosystems.js +260 -99
  33. package/lib/ecosystems/golem.js +11 -1
  34. package/lib/ecosystems/gradleutils.js +185 -9
  35. package/lib/ecosystems/jsEvidence.js +19 -20
  36. package/lib/ecosystems/kosi.js +1263 -0
  37. package/lib/ecosystems/npmutils.js +110 -9
  38. package/lib/ecosystems/parsers-crystal.js +179 -0
  39. package/lib/ecosystems/parsers-dotnet.js +120 -49
  40. package/lib/ecosystems/parsers-elm.js +816 -0
  41. package/lib/ecosystems/parsers-gleam.js +1 -1
  42. package/lib/ecosystems/parsers-go.js +47 -9
  43. package/lib/ecosystems/parsers-js.js +171 -50
  44. package/lib/ecosystems/parsers-julia.js +268 -0
  45. package/lib/ecosystems/parsers-lua.js +218 -0
  46. package/lib/ecosystems/parsers-misc.js +919 -161
  47. package/lib/ecosystems/parsers-nim.js +221 -0
  48. package/lib/ecosystems/parsers-opam.js +180 -0
  49. package/lib/ecosystems/parsers-perl.js +277 -0
  50. package/lib/ecosystems/parsers-python.js +27 -15
  51. package/lib/ecosystems/parsers-r.js +148 -0
  52. package/lib/ecosystems/parsers-rebar.js +411 -0
  53. package/lib/ecosystems/parsers-rust.js +954 -33
  54. package/lib/ecosystems/parsers-spack.js +204 -0
  55. package/lib/ecosystems/parsers-stack.js +264 -0
  56. package/lib/ecosystems/parsers-terraform.js +194 -0
  57. package/lib/ecosystems/rubyutils.js +1426 -166
  58. package/lib/ecosystems/rusi.js +158 -7
  59. package/lib/evinser/evinser.js +547 -129
  60. package/lib/evinser/swiftsem.js +1914 -302
  61. package/lib/helpers/agenticToolutils.js +925 -0
  62. package/lib/helpers/bomSigner.js +652 -221
  63. package/lib/inventory/agentFormulationParser.js +57 -4
  64. package/lib/inventory/aiCollector.js +504 -10
  65. package/lib/inventory/aiInventory.js +12 -0
  66. package/lib/inventory/analyzer.js +488 -30
  67. package/lib/inventory/astWorker.js +6 -0
  68. package/lib/inventory/atomUtils.js +568 -31
  69. package/lib/inventory/auditCategories.js +8 -0
  70. package/lib/inventory/cbomutils.js +30 -0
  71. package/lib/inventory/cdxrs.js +110 -14
  72. package/lib/inventory/communityAiConfigParser.js +215 -2
  73. package/lib/inventory/depsUtils.js +183 -11
  74. package/lib/inventory/display.js +4 -5
  75. package/lib/inventory/dosai.js +627 -13
  76. package/lib/inventory/dynamic.js +39 -1
  77. package/lib/inventory/envcontext.js +9 -6
  78. package/lib/inventory/evidenceUtils.js +26 -5
  79. package/lib/inventory/fetchBatch.js +190 -19
  80. package/lib/inventory/fetchRate.js +74 -11
  81. package/lib/inventory/forgeEnricher.js +3 -2
  82. package/lib/inventory/jvmToolEnv.js +6 -5
  83. package/lib/inventory/mcpConfigParser.js +166 -2
  84. package/lib/inventory/mcpDiscovery.js +11 -0
  85. package/lib/inventory/mcpServerManifest.js +389 -0
  86. package/lib/inventory/mcpbBundle.js +419 -0
  87. package/lib/inventory/plugins.js +3 -0
  88. package/lib/inventory/protobom.js +62 -89
  89. package/lib/inventory/protobomLoader.js +4 -0
  90. package/lib/inventory/purl.js +152 -3
  91. package/lib/inventory/rustFormulationParser.js +1 -1
  92. package/lib/inventory/sbomDocument.js +2 -70
  93. package/lib/inventory/source.js +47 -23
  94. package/lib/inventory/stylePackageRefs.js +41 -0
  95. package/lib/inventory/svelteUtils.js +524 -0
  96. package/lib/inventory/traceRunner.js +210 -21
  97. package/lib/managers/binary.js +115 -24
  98. package/lib/managers/docker.js +440 -20
  99. package/lib/managers/oci.js +39 -1
  100. package/lib/parsers/cmakeLists.js +452 -0
  101. package/lib/parsers/huggingfaceUtils.js +15 -7
  102. package/lib/parsers/largeJson.js +454 -0
  103. package/lib/parsers/npmrc.js +19 -1
  104. package/lib/parsers/onnx.js +294 -0
  105. package/lib/parsers/safetensors.js +114 -0
  106. package/lib/stages/postgen/introspection/markers.js +29 -6
  107. package/lib/stages/postgen/postgen.js +237 -16
  108. package/lib/third-party/arborist/snapshots/calc-dep-flags.test.cjs +462 -0
  109. package/lib/validator/bomValidator.js +6 -16
  110. package/lib/validator/index.js +48 -10
  111. package/lib/validator/reporters/console.js +3 -0
  112. package/lib/validator/reporters/json.js +1 -0
  113. package/lib/validator/reporters/sarif.js +7 -0
  114. package/package.json +27 -27
  115. package/types/lib/audit/targets.d.ts.map +1 -1
  116. package/types/lib/cli/bomAssembly.d.ts +2 -1
  117. package/types/lib/cli/bomAssembly.d.ts.map +1 -1
  118. package/types/lib/cli/cliOptions.d.ts +33 -1
  119. package/types/lib/cli/cliOptions.d.ts.map +1 -1
  120. package/types/lib/cli/index.d.ts +2 -2
  121. package/types/lib/cli/index.d.ts.map +1 -1
  122. package/types/lib/cli/jsBom.d.ts +23 -0
  123. package/types/lib/cli/jsBom.d.ts.map +1 -1
  124. package/types/lib/cli/jvmBom.d.ts.map +1 -1
  125. package/types/lib/cli/managedBom.d.ts +33 -0
  126. package/types/lib/cli/managedBom.d.ts.map +1 -1
  127. package/types/lib/cli/nativeBom.d.ts +88 -8
  128. package/types/lib/cli/nativeBom.d.ts.map +1 -1
  129. package/types/lib/core/activity.d.ts.map +1 -1
  130. package/types/lib/core/env.d.ts +21 -0
  131. package/types/lib/core/env.d.ts.map +1 -1
  132. package/types/lib/core/fs.d.ts +55 -0
  133. package/types/lib/core/fs.d.ts.map +1 -1
  134. package/types/lib/core/metadataProperties.d.ts +39 -0
  135. package/types/lib/core/metadataProperties.d.ts.map +1 -0
  136. package/types/lib/core/projectConfig.d.ts +6 -2
  137. package/types/lib/core/projectConfig.d.ts.map +1 -1
  138. package/types/lib/core/userAgent.d.ts +56 -0
  139. package/types/lib/core/userAgent.d.ts.map +1 -0
  140. package/types/lib/ecosystems/bunutils.d.ts +12 -5
  141. package/types/lib/ecosystems/bunutils.d.ts.map +1 -1
  142. package/types/lib/ecosystems/cargoCache.d.ts +75 -0
  143. package/types/lib/ecosystems/cargoCache.d.ts.map +1 -0
  144. package/types/lib/ecosystems/caxa.d.ts +14 -0
  145. package/types/lib/ecosystems/caxa.d.ts.map +1 -1
  146. package/types/lib/ecosystems/cmakeResolver.d.ts +23 -0
  147. package/types/lib/ecosystems/cmakeResolver.d.ts.map +1 -1
  148. package/types/lib/ecosystems/cppEvidence.d.ts +2 -2
  149. package/types/lib/ecosystems/cppEvidence.d.ts.map +1 -1
  150. package/types/lib/ecosystems/ecosystems.d.ts +15 -1
  151. package/types/lib/ecosystems/ecosystems.d.ts.map +1 -1
  152. package/types/lib/ecosystems/golem.d.ts.map +1 -1
  153. package/types/lib/ecosystems/gradleutils.d.ts +40 -4
  154. package/types/lib/ecosystems/gradleutils.d.ts.map +1 -1
  155. package/types/lib/ecosystems/jsEvidence.d.ts +5 -2
  156. package/types/lib/ecosystems/jsEvidence.d.ts.map +1 -1
  157. package/types/lib/ecosystems/kosi.d.ts +86 -0
  158. package/types/lib/ecosystems/kosi.d.ts.map +1 -0
  159. package/types/lib/ecosystems/npmutils.d.ts +42 -0
  160. package/types/lib/ecosystems/npmutils.d.ts.map +1 -1
  161. package/types/lib/ecosystems/parsers-crystal.d.ts +27 -0
  162. package/types/lib/ecosystems/parsers-crystal.d.ts.map +1 -0
  163. package/types/lib/ecosystems/parsers-dotnet.d.ts +19 -0
  164. package/types/lib/ecosystems/parsers-dotnet.d.ts.map +1 -1
  165. package/types/lib/ecosystems/parsers-elm.d.ts +79 -0
  166. package/types/lib/ecosystems/parsers-elm.d.ts.map +1 -0
  167. package/types/lib/ecosystems/parsers-go.d.ts +10 -0
  168. package/types/lib/ecosystems/parsers-go.d.ts.map +1 -1
  169. package/types/lib/ecosystems/parsers-js.d.ts +10 -4
  170. package/types/lib/ecosystems/parsers-js.d.ts.map +1 -1
  171. package/types/lib/ecosystems/parsers-julia.d.ts +57 -0
  172. package/types/lib/ecosystems/parsers-julia.d.ts.map +1 -0
  173. package/types/lib/ecosystems/parsers-lua.d.ts +50 -0
  174. package/types/lib/ecosystems/parsers-lua.d.ts.map +1 -0
  175. package/types/lib/ecosystems/parsers-misc.d.ts +90 -3
  176. package/types/lib/ecosystems/parsers-misc.d.ts.map +1 -1
  177. package/types/lib/ecosystems/parsers-nim.d.ts +43 -0
  178. package/types/lib/ecosystems/parsers-nim.d.ts.map +1 -0
  179. package/types/lib/ecosystems/parsers-opam.d.ts +31 -0
  180. package/types/lib/ecosystems/parsers-opam.d.ts.map +1 -0
  181. package/types/lib/ecosystems/parsers-perl.d.ts +36 -0
  182. package/types/lib/ecosystems/parsers-perl.d.ts.map +1 -0
  183. package/types/lib/ecosystems/parsers-python.d.ts.map +1 -1
  184. package/types/lib/ecosystems/parsers-r.d.ts +35 -0
  185. package/types/lib/ecosystems/parsers-r.d.ts.map +1 -0
  186. package/types/lib/ecosystems/parsers-rebar.d.ts +42 -0
  187. package/types/lib/ecosystems/parsers-rebar.d.ts.map +1 -0
  188. package/types/lib/ecosystems/parsers-rust.d.ts +199 -0
  189. package/types/lib/ecosystems/parsers-rust.d.ts.map +1 -1
  190. package/types/lib/ecosystems/parsers-spack.d.ts +33 -0
  191. package/types/lib/ecosystems/parsers-spack.d.ts.map +1 -0
  192. package/types/lib/ecosystems/parsers-stack.d.ts +35 -0
  193. package/types/lib/ecosystems/parsers-stack.d.ts.map +1 -0
  194. package/types/lib/ecosystems/parsers-terraform.d.ts +34 -0
  195. package/types/lib/ecosystems/parsers-terraform.d.ts.map +1 -0
  196. package/types/lib/ecosystems/pythonutils.d.ts +1 -1
  197. package/types/lib/ecosystems/rubyutils.d.ts +143 -2
  198. package/types/lib/ecosystems/rubyutils.d.ts.map +1 -1
  199. package/types/lib/ecosystems/rusi.d.ts +13 -0
  200. package/types/lib/ecosystems/rusi.d.ts.map +1 -1
  201. package/types/lib/evinser/evinser.d.ts +81 -2
  202. package/types/lib/evinser/evinser.d.ts.map +1 -1
  203. package/types/lib/evinser/swiftsem.d.ts +280 -15
  204. package/types/lib/evinser/swiftsem.d.ts.map +1 -1
  205. package/types/lib/helpers/agenticToolutils.d.ts +87 -0
  206. package/types/lib/helpers/agenticToolutils.d.ts.map +1 -0
  207. package/types/lib/helpers/bomSigner.d.ts +106 -13
  208. package/types/lib/helpers/bomSigner.d.ts.map +1 -1
  209. package/types/lib/inventory/agentFormulationParser.d.ts.map +1 -1
  210. package/types/lib/inventory/aiCollector.d.ts.map +1 -1
  211. package/types/lib/inventory/aiInventory.d.ts.map +1 -1
  212. package/types/lib/inventory/analyzer.d.ts.map +1 -1
  213. package/types/lib/inventory/atomUtils.d.ts +145 -3
  214. package/types/lib/inventory/atomUtils.d.ts.map +1 -1
  215. package/types/lib/inventory/auditCategories.d.ts +4 -0
  216. package/types/lib/inventory/auditCategories.d.ts.map +1 -1
  217. package/types/lib/inventory/cbomutils.d.ts.map +1 -1
  218. package/types/lib/inventory/cdxrs.d.ts +8 -3
  219. package/types/lib/inventory/cdxrs.d.ts.map +1 -1
  220. package/types/lib/inventory/communityAiConfigParser.d.ts.map +1 -1
  221. package/types/lib/inventory/depsUtils.d.ts +15 -0
  222. package/types/lib/inventory/depsUtils.d.ts.map +1 -1
  223. package/types/lib/inventory/display.d.ts.map +1 -1
  224. package/types/lib/inventory/dosai.d.ts +87 -1
  225. package/types/lib/inventory/dosai.d.ts.map +1 -1
  226. package/types/lib/inventory/dynamic.d.ts.map +1 -1
  227. package/types/lib/inventory/envcontext.d.ts.map +1 -1
  228. package/types/lib/inventory/evidenceUtils.d.ts.map +1 -1
  229. package/types/lib/inventory/fetchBatch.d.ts +34 -0
  230. package/types/lib/inventory/fetchBatch.d.ts.map +1 -1
  231. package/types/lib/inventory/fetchRate.d.ts +9 -6
  232. package/types/lib/inventory/fetchRate.d.ts.map +1 -1
  233. package/types/lib/inventory/forgeEnricher.d.ts.map +1 -1
  234. package/types/lib/inventory/jvmToolEnv.d.ts +5 -4
  235. package/types/lib/inventory/jvmToolEnv.d.ts.map +1 -1
  236. package/types/lib/inventory/mcpConfigParser.d.ts.map +1 -1
  237. package/types/lib/inventory/mcpDiscovery.d.ts.map +1 -1
  238. package/types/lib/inventory/mcpServerManifest.d.ts +19 -0
  239. package/types/lib/inventory/mcpServerManifest.d.ts.map +1 -0
  240. package/types/lib/inventory/mcpbBundle.d.ts +19 -0
  241. package/types/lib/inventory/mcpbBundle.d.ts.map +1 -0
  242. package/types/lib/inventory/plugins.d.ts.map +1 -1
  243. package/types/lib/inventory/protobom.d.ts +18 -13
  244. package/types/lib/inventory/protobom.d.ts.map +1 -1
  245. package/types/lib/inventory/protobomLoader.d.ts.map +1 -1
  246. package/types/lib/inventory/purl.d.ts +71 -2
  247. package/types/lib/inventory/purl.d.ts.map +1 -1
  248. package/types/lib/inventory/sbomDocument.d.ts.map +1 -1
  249. package/types/lib/inventory/source.d.ts.map +1 -1
  250. package/types/lib/inventory/stylePackageRefs.d.ts +17 -0
  251. package/types/lib/inventory/stylePackageRefs.d.ts.map +1 -0
  252. package/types/lib/inventory/svelteUtils.d.ts +124 -0
  253. package/types/lib/inventory/svelteUtils.d.ts.map +1 -0
  254. package/types/lib/inventory/traceRunner.d.ts +47 -1
  255. package/types/lib/inventory/traceRunner.d.ts.map +1 -1
  256. package/types/lib/managers/binary.d.ts +30 -1
  257. package/types/lib/managers/binary.d.ts.map +1 -1
  258. package/types/lib/managers/docker.d.ts +29 -0
  259. package/types/lib/managers/docker.d.ts.map +1 -1
  260. package/types/lib/managers/oci.d.ts +14 -0
  261. package/types/lib/managers/oci.d.ts.map +1 -1
  262. package/types/lib/parsers/cmakeLists.d.ts +76 -0
  263. package/types/lib/parsers/cmakeLists.d.ts.map +1 -0
  264. package/types/lib/parsers/huggingfaceUtils.d.ts +8 -1
  265. package/types/lib/parsers/huggingfaceUtils.d.ts.map +1 -1
  266. package/types/lib/parsers/largeJson.d.ts +52 -0
  267. package/types/lib/parsers/largeJson.d.ts.map +1 -0
  268. package/types/lib/parsers/npmrc.d.ts +5 -0
  269. package/types/lib/parsers/npmrc.d.ts.map +1 -1
  270. package/types/lib/parsers/onnx.d.ts +28 -0
  271. package/types/lib/parsers/onnx.d.ts.map +1 -0
  272. package/types/lib/parsers/safetensors.d.ts +22 -0
  273. package/types/lib/parsers/safetensors.d.ts.map +1 -0
  274. package/types/lib/stages/postgen/introspection/markers.d.ts +3 -2
  275. package/types/lib/stages/postgen/introspection/markers.d.ts.map +1 -1
  276. package/types/lib/stages/postgen/postgen.d.ts +33 -0
  277. package/types/lib/stages/postgen/postgen.d.ts.map +1 -1
  278. package/types/lib/validator/bomValidator.d.ts.map +1 -1
  279. package/types/lib/validator/index.d.ts +10 -1
  280. package/types/lib/validator/index.d.ts.map +1 -1
  281. package/types/lib/validator/reporters/console.d.ts.map +1 -1
  282. package/types/lib/validator/reporters/json.d.ts.map +1 -1
  283. package/types/lib/validator/reporters/sarif.d.ts.map +1 -1
@@ -0,0 +1,36 @@
1
+ /**
2
+ * Perl parser for `cpanfile` and `cpanfile.snapshot`.
3
+ *
4
+ * Carton snapshots the resolved install set as a text document: one entry per
5
+ * distribution, each carrying the `pathname` it was fetched from (which
6
+ * encodes the PAUSE author id), the packages it provides, and the
7
+ * requirements it was resolved against. The declared `cpanfile` lists the
8
+ * project's own requirements.
9
+ *
10
+ * Distributions are identified with the registered `cpan` purl type, whose
11
+ * rules require the author id as the namespace
12
+ * (`pkg:cpan/<AUTHOR>/<Distribution>@<version>`).
13
+ */
14
+ /**
15
+ * Parse a `cpanfile.snapshot` into distributions with a dependency graph.
16
+ *
17
+ * @param {string} snapshotFile Path to `cpanfile.snapshot`
18
+ * @param {string} [cpanfileFile] Path to `cpanfile`, if present
19
+ * @returns {{ pkgList: object[], dependencies: object[] }}
20
+ */
21
+ export declare function parseCpanSnapshot(snapshotFile: string, cpanfileFile?: string): {
22
+ pkgList: object[];
23
+ dependencies: object[];
24
+ };
25
+ /**
26
+ * Collect the requirement names declared in a `cpanfile`.
27
+ *
28
+ * Only the `requires` keyword outside phase blocks is read; phases such as
29
+ * `on 'test'` are ignored so test-only modules do not become direct
30
+ * dependencies.
31
+ *
32
+ * @param {string} cpanfileFile Path to `cpanfile`
33
+ * @returns {Set<string>} Declared requirement names
34
+ */
35
+ export declare function directRequirementsFromCpanfile(cpanfileFile: string): Set<string>;
36
+ //# sourceMappingURL=parsers-perl.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parsers-perl.d.ts","sourceRoot":"","sources":["../../../lib/ecosystems/parsers-perl.js"],"names":[],"mappings":"AAIA;;;;;;;;;;;;GAYG;AAEH;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,YAAY,EAJnC,MAImC,EAAE,YAAY,AAHzD,CACA,EADQ,M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,CAmCzB;AAED;;;;GAIG;AACH,wBAAsB,gBAAgB,CAAC,WAAW,EAFvC,MAEuC,qBAqBjD;AA6CD;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,gBAAgB,QAAA,EAAE,IAAI,QAAA;;;;;;;;;EAkLvD;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,QAAA,MAiCzC;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,KAAA,QAkBzC;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,gBAAgB,CAAC,eAAe,EAHrC,MAGqC,GAFnC;IAAE,OAAO,EAAE,MAAM,EAAE,CAAC;IAAC,eAAe,EAAE,MAAM,CAAA;CAAE,CA8C1D"}
@@ -0,0 +1,35 @@
1
+ /**
2
+ * R project parser for renv lock files.
3
+ *
4
+ * `renv.lock` records the R version, the repositories packages were resolved
5
+ * from, and every package in the project library with its exact version, an
6
+ * integrity hash, and the names of the packages it requires. The lock is a
7
+ * JSON document, which makes it a reliable offline source of both the
8
+ * resolved dependency set and the graph between packages.
9
+ *
10
+ * Packages are identified with the registered `cran` purl type
11
+ * (`pkg:cran/<Package>@<Version>`). Requirement strings may carry version
12
+ * constraints (`"R (>= 3.6)"`); only the leading package name is used, and
13
+ * the R runtime itself is recorded as the parent's version rather than an
14
+ * edge.
15
+ */
16
+ /**
17
+ * Parse an `renv.lock` file.
18
+ *
19
+ * @param {string} renvLockFile Path to `renv.lock`
20
+ * @returns {{
21
+ * pkgList: object[],
22
+ * dependencies: object[],
23
+ * rootInputs: string[],
24
+ * parentComponent: object,
25
+ * rVersion: string|undefined
26
+ * }}
27
+ */
28
+ export declare function parseRenvLock(renvLockFile: string): {
29
+ pkgList: object[];
30
+ dependencies: object[];
31
+ rootInputs: string[];
32
+ parentComponent: object;
33
+ rVersion: string | undefined;
34
+ };
35
+ //# sourceMappingURL=parsers-r.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parsers-r.d.ts","sourceRoot":"","sources":["../../../lib/ecosystems/parsers-r.js"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;GAcG;AAEH;;;;;;;;;;;GAWG;AACH,wBAAgB,aAAa,CAAC,YAAY,EAT/B,MAS+B,GAR7B;IACR,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,eAAe,EAAE,MAAM,CAAC;IACxB,QAAQ,EAAE,MAAM,GAAC,SAAS,CAAA;CAC3B,CAsGH"}
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Erlang rebar3 parser for `rebar.lock`.
3
+ *
4
+ * A rebar lock holds one or two Erlang terms, each ended by a period:
5
+ *
6
+ * {"1.2.0", [{<<"cowboy">>,{pkg,<<"cowboy">>,<<"2.10.0">>},0}]}.
7
+ * [{pkg_hash, [{<<"cowboy">>, <<"3AFD...">>}]},
8
+ * {pkg_hash_ext, [...]}].
9
+ *
10
+ * The first term pairs the lock format version with the locked dependency
11
+ * list; the hashes live in a separate second term, which is absent from locks
12
+ * that hold no hex packages. Lock format 1.0.0 omitted the version and wrote
13
+ * the dependency list as the only term.
14
+ *
15
+ * Rather than a large regular expression over the surface syntax, a small
16
+ * recursive reader parses the terms into plain JavaScript values: tuples and
17
+ * lists become arrays, binaries and strings become strings, atoms become
18
+ * strings. Only the shapes rebar actually writes are understood; anything
19
+ * else is skipped.
20
+ *
21
+ * Hex dependencies are identified with the registered `hex` purl type, since
22
+ * rebar resolves Erlang packages through hex.pm. The `pkg_hash` values hex
23
+ * publishes are SHA-256 digests of the package tarball, so they are emitted
24
+ * into the CycloneDX `hashes` array where consumers expect content hashes.
25
+ */
26
+ /**
27
+ * Parse a `rebar.lock` file.
28
+ *
29
+ * @param {string} rebarLockFile Path to `rebar.lock`
30
+ * @returns {{ pkgList: object[] }} Locked packages
31
+ */
32
+ export declare function parseRebarLock(rebarLockFile: string): {
33
+ pkgList: object[];
34
+ };
35
+ /**
36
+ * Parse every period-terminated Erlang term in a source text.
37
+ *
38
+ * @param {string} text Source text
39
+ * @returns {Array} Parsed terms, in file order
40
+ */
41
+ export declare function parseErlangTerms(text: string): any[];
42
+ //# sourceMappingURL=parsers-rebar.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parsers-rebar.d.ts","sourceRoot":"","sources":["../../../lib/ecosystems/parsers-rebar.js"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,aAAa,EAHjC,MAGiC,GAF/B;IAAE,OAAO,EAAE,MAAM,EAAE,CAAA;CAAE,CAyDjC;AAuHD;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAH1B,MAG0B,SA2BpC"}
@@ -44,6 +44,205 @@ export declare function parseCargoManifestDependencyData(cargoTomlFile: string,
44
44
  * @returns {Object[]} Array of dependency relationship objects with ref and dependsOn fields
45
45
  */
46
46
  export declare function parseCargoDependencyData(cargoLockData: string): Object[];
47
+ /**
48
+ * Normalize a cargo dependency kind to the vocabulary used by the cargo
49
+ * manifest parsers.
50
+ *
51
+ * `cargo metadata` encodes a normal dependency as `null` rather than a string,
52
+ * so a truthiness test would silently leave runtime dependencies unlabelled.
53
+ *
54
+ * @param {string|null|undefined} kind Dependency kind as reported by cargo
55
+ * @returns {string} One of `runtime`, `build` or `dev`
56
+ */
57
+ export declare function normalizeCargoDepKind(kind: string | null | undefined): string;
58
+ /**
59
+ * Parse a cargo package id into its name and version.
60
+ *
61
+ * cargo 1.77 and later emit the package id spec form
62
+ * (`registry+https://...#name@1.0.0`, or `path+file:///p/foo#1.0.0` where the
63
+ * name is carried by the path); earlier releases emit `name 1.0.0 (source)`.
64
+ *
65
+ * @param {string} packageId cargo package id
66
+ * @returns {{name: string, version: string}|undefined} Parsed identity
67
+ */
68
+ export declare function parseCargoPackageId(packageId: string): {
69
+ name: string;
70
+ version: string;
71
+ } | undefined;
72
+ /**
73
+ * Build the `name@version` key used to correlate cargo components across the
74
+ * lock file, the manifests and `cargo metadata`.
75
+ *
76
+ * @param {{name: string, version: string}} pkg Package identity
77
+ * @returns {string} Correlation key
78
+ */
79
+ export declare function cargoComponentKey(pkg: {
80
+ name: string;
81
+ version: string;
82
+ }): string;
83
+ /**
84
+ * Convert a cargo purl or bom-ref into a `name@version` correlation key.
85
+ *
86
+ * @param {string} purl cargo purl
87
+ * @returns {string} Correlation key
88
+ */
89
+ export declare function cargoPurlToComponentKey(purl: string): string;
90
+ /**
91
+ * Collect the dependency kinds and platform gates declared by a single
92
+ * `Cargo.toml`, keyed by the crate name that cargo resolves the entry to.
93
+ *
94
+ * Manifests declare version requirements rather than resolved versions, so the
95
+ * returned map is keyed by name alone and is meant to label the edges leaving a
96
+ * workspace member in the lock file graph.
97
+ *
98
+ * @param {string} cargoTomlFile Cargo.toml path
99
+ * @param {object} [context] Workspace resolution context
100
+ * @returns {Map<string, {kinds: Set<string>, targets: Set<string>, optional: boolean}>} Declared edges
101
+ */
102
+ export declare function parseCargoManifestDependencyKinds(cargoTomlFile: string, context?: object): Map<string, {
103
+ kinds: Set<string>;
104
+ targets: Set<string>;
105
+ optional: boolean;
106
+ }>;
107
+ /**
108
+ * Roll per-edge cargo dependency kinds up to an effective kind per component.
109
+ *
110
+ * A crate is only dev-only when *every* path reaching it from a workspace root
111
+ * traverses a dev edge, so a crate shared between a dev dependency and a normal
112
+ * one keeps its runtime kind. Cargo never builds the dev dependencies of a
113
+ * dependency, so dev edges are followed from the workspace roots alone.
114
+ *
115
+ * @param {object} graph Dependency graph
116
+ * @param {string[]} graph.rootKeys Workspace member component keys
117
+ * @param {Map<string, Array<{to: string, kind: string, target?: string}>>} graph.edges Adjacency map
118
+ * @returns {Map<string, {kind: string, kinds: Set<string>, targets: Set<string>, targetGated: boolean}>} Effective kinds
119
+ */
120
+ export declare function rollupCargoDependencyKinds({ rootKeys, edges }: {
121
+ rootKeys: string[];
122
+ edges: Map<string, Array<{
123
+ to: string;
124
+ kind: string;
125
+ target?: string;
126
+ }>>;
127
+ }): Map<string, {
128
+ kind: string;
129
+ kinds: Set<string>;
130
+ targets: Set<string>;
131
+ targetGated: boolean;
132
+ }>;
133
+ /**
134
+ * Build a cargo dependency graph from the `resolve` section of
135
+ * `cargo metadata --format-version 1`.
136
+ *
137
+ * @param {object} metadata Parsed `cargo metadata` output
138
+ * @returns {{rootKeys: string[], edges: Map<string, Array<object>>, packageInfo: Map<string, object>, resolvedKeys: Set<string>}} Graph
139
+ */
140
+ export declare function parseCargoMetadataResolve(metadata: object): {
141
+ rootKeys: string[];
142
+ edges: Map<string, Array<object>>;
143
+ packageInfo: Map<string, object>;
144
+ resolvedKeys: Set<string>;
145
+ };
146
+ /**
147
+ * Build a cargo dependency graph from the lock file relationships, labelling
148
+ * the edges that leave a workspace member with the kinds declared by its
149
+ * manifest.
150
+ *
151
+ * The lock file is the union of every dependency kind and every target triple,
152
+ * so only the manifests can distinguish them. The resulting labels are exact at
153
+ * depth one and inherited below it, which is enough to identify dev-only and
154
+ * build-only subtrees without invoking cargo.
155
+ *
156
+ * @param {object[]} lockDependencies Relationships from {@link parseCargoDependencyData}
157
+ * @param {Map<string, Map<string, object>>} declaredEdgesByRoot Declared edges keyed by root component key
158
+ * @returns {{rootKeys: string[], edges: Map<string, Array<object>>}} Graph
159
+ */
160
+ export declare function buildCargoLockDependencyGraph(lockDependencies: object[], declaredEdgesByRoot: Map<string, Map<string, object>>): {
161
+ rootKeys: string[];
162
+ edges: Map<string, Array<object>>;
163
+ };
164
+ /**
165
+ * Annotate cargo components with their effective dependency kind, platform
166
+ * gates and scope.
167
+ *
168
+ * Components reachable only through dev edges are scoped `excluded` so
169
+ * `--required-only` drops them. Build dependencies stay required because a
170
+ * build script is part of producing the artifact; the kind is recorded as a
171
+ * property so a consumer can filter on it.
172
+ *
173
+ * @param {object[]} pkgList Components to annotate
174
+ * @param {Map<string, object>} rollup Effective kinds from {@link rollupCargoDependencyKinds}
175
+ * @param {Map<string, object>} [packageInfo] Extra per-package facts
176
+ * @param {object} [options] Annotation options
177
+ * @param {boolean} [options.resolveIsComplete] The rollup covers every workspace in the scan, so a
178
+ * component missing from it is an optional dependency no feature activates
179
+ * @returns {object[]} The annotated components
180
+ */
181
+ export declare function applyCargoDependencyKindMetadata(pkgList: object[], rollup: Map<string, object>, packageInfo?: Map<string, object>, options?: {
182
+ resolveIsComplete?: boolean;
183
+ }): object[];
184
+ /**
185
+ * Recover the upstream version of a native library from the version of the
186
+ * crate that ships it.
187
+ *
188
+ * The `-sys` and `-src` crates carry the upstream version as semver build
189
+ * metadata, because the crate's own version tracks the binding's releases
190
+ * rather than the library's: `openssl-src@300.6.1+3.6.3` ships OpenSSL 3.6.3
191
+ * and `curl-sys@0.4.74+curl-8.9.0` ships curl 8.9.0.
192
+ *
193
+ * @param {string} crateVersion Version of the providing crate
194
+ * @returns {string} Upstream version, or an empty string when it is not encoded
195
+ */
196
+ export declare function cargoUpstreamVersionFromCrateVersion(crateVersion: string): string;
197
+ /**
198
+ * Recover the version of a vendored native library from the C source the crate
199
+ * ships.
200
+ *
201
+ * A `-sys` crate that bundles its library carries the upstream version in a
202
+ * header define - `ZLIB_VERSION`, `SQLITE_VERSION`, `OPENSSL_VERSION_TEXT` -
203
+ * which is the only statement of the version for the crates that do not encode
204
+ * it in their own version. A crate often ships more than one variant, so a
205
+ * candidate sitting in a directory named after a feature this build did not
206
+ * enable is dropped: `libz-sys` ships both `src/zlib` and `src/zlib-ng`, and
207
+ * only one of them is compiled.
208
+ *
209
+ * @param {object} args Resolution inputs
210
+ * @param {string} args.crateDir Directory holding the crate's unpacked source
211
+ * @param {string} args.links The crate's `links` value
212
+ * @param {string} args.libraryName Normalized library name
213
+ * @param {string[]} [args.declaredFeatures] Features the crate declares
214
+ * @param {Set<string>} [args.resolvedFeatures] Features the resolver enabled
215
+ * @returns {{version: string, evidence: string, candidates: string[]}} Version and where it came from
216
+ */
217
+ export declare function resolveCargoVendoredLibraryVersion({ crateDir, links, libraryName, declaredFeatures, resolvedFeatures, }: {
218
+ crateDir: string;
219
+ links: string;
220
+ libraryName: string;
221
+ declaredFeatures?: string[];
222
+ resolvedFeatures?: Set<string>;
223
+ }): {
224
+ version: string;
225
+ evidence: string;
226
+ candidates: string[];
227
+ };
228
+ /**
229
+ * Build components for the native libraries that `-sys` crates link.
230
+ *
231
+ * A crate declaring `links = "openssl"` puts a C library into the artifact that
232
+ * the cargo dependency graph cannot describe: its advisories and its license
233
+ * obligations belong to OpenSSL, not to the Rust binding. When the resolver
234
+ * enabled a vendoring feature, that library is compiled into the binary, which
235
+ * makes it a component of the delivered assembly.
236
+ *
237
+ * @param {Map<string, object>} packageInfo Per-package facts from {@link parseCargoMetadataResolve}
238
+ * @param {Map<string, Array<object>>} edges Dependency edges keyed by component key
239
+ * @param {Map<string, object>} rollup Effective kinds, used to skip crates no build reaches
240
+ * @returns {{components: object[], dependencies: object[]}} Native library components and their edges
241
+ */
242
+ export declare function buildCargoNativeLibraryComponents(packageInfo: Map<string, object>, edges: Map<string, Array<object>>, rollup: Map<string, object>): {
243
+ components: object[];
244
+ dependencies: object[];
245
+ };
47
246
  /**
48
247
  * Parses tab-separated cargo-auditable binary metadata output and returns a list
49
248
  * of Rust package components. Optionally fetches crates.io metadata when
@@ -1 +1 @@
1
- {"version":3,"file":"parsers-rust.d.ts","sourceRoot":"","sources":["../../../lib/ecosystems/parsers-rust.js"],"names":[],"mappings":"AAunBA;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAsB,kBAAkB,CACtC,aAAa,QAAA,EACb,MAAM,GAPG,OAOK,EACd,WAAW,GAPF,MAOO,EAChB,OAAO,KAAK,SAuQb;AAED;;;;;;;;GAQG;AACH,wBAAsB,cAAc,CAClC,aAAa,QAAA,EACb,MAAM,GAPG,OAOK,EACd,WAAW,GAPF,MAOO,SA8FjB;AAgCD;;;;;;;GAOG;AACH,wBAAgB,gCAAgC,CAAC,aAAa,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,WAAW,EALlD,GAAG,CAAC,MAAM,EAAE,MAAM,CAKgC,EAAE,KAAK,EAJzD,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,CAIgC,EAAE,MAAM,EAHjE,GAAG,CAAC,MAAM,EAAE,MAAM,CAG+C,GAF/D;IAAC,UAAU,EAAE,MAAM,EAAE,CAAC;IAAC,YAAY,EAAE,MAAM,EAAE,CAAA;CAAC,CAwJ1D;AAED;;;;;;;GAOG;AACH,wBAAsB,uBAAuB,CAAC,SAAS,EAH5C,MAG4C,GAF1C,OAAO,CAAC,MAAM,EAAE,CAAC,CA4B7B"}
@@ -0,0 +1,33 @@
1
+ /**
2
+ * HPC Spack parser for `spack.lock`.
3
+ *
4
+ * Spack writes a JSON lock file when an environment is concretised:
5
+ *
6
+ * - `roots` — the specs the user asked for, each as `{hash, spec}`.
7
+ * - `concrete_specs` — every node of the resolved DAG, keyed by its DAG
8
+ * hash. A node carries its `name`, `version`, `namespace`, the compiler
9
+ * and architecture it was built for, and a `dependencies` list whose
10
+ * entries reference other nodes by hash.
11
+ *
12
+ * The DAG hash is the identity Spack itself uses: two builds of the same
13
+ * version with different variants or compilers are different hashes, so the
14
+ * graph is keyed by hash throughout and the hash is carried into each
15
+ * component's bom-ref.
16
+ *
17
+ * No `spack` purl type is registered, so nodes are identified as generic
18
+ * packages carrying a `cdx:purl:proposedType=spack` property, following the
19
+ * convention used for nix and zig. The DAG hash is kept as a property because
20
+ * it identifies the concrete build, not the artifact bytes.
21
+ */
22
+ /**
23
+ * Parse a `spack.lock` file.
24
+ *
25
+ * @param {string} spackLockFile Path to `spack.lock`
26
+ * @returns {{ pkgList: object[], dependencies: object[], rootInputs: string[] }}
27
+ */
28
+ export declare function parseSpackLock(spackLockFile: string): {
29
+ pkgList: object[];
30
+ dependencies: object[];
31
+ rootInputs: string[];
32
+ };
33
+ //# sourceMappingURL=parsers-spack.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parsers-spack.d.ts","sourceRoot":"","sources":["../../../lib/ecosystems/parsers-spack.js"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,aAAa,EAHjC,MAGiC,GAF/B;IAAE,OAAO,EAAE,MAAM,EAAE,CAAC;IAAC,YAAY,EAAE,MAAM,EAAE,CAAC;IAAC,UAAU,EAAE,MAAM,EAAE,CAAA;CAAE,CAgE/E"}
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Haskell Stack parser for `stack.yaml` and its lock file.
3
+ *
4
+ * Stack resolves packages from a snapshot plus the `extra-deps` a project
5
+ * declares, and writes the completed locations to `stack.yaml.lock` (named
6
+ * after the configuration file, so a custom `foo.yaml` locks to
7
+ * `foo.yaml.lock`). The lock is YAML with two lists:
8
+ *
9
+ * - `packages` — one entry per extra-dep, each holding the `original`
10
+ * incomplete specification and the `completed` location. A Hackage
11
+ * location is the string `<name>-<version>@sha256:<hex>,<size>`; a
12
+ * repository location carries `url`, `commit` and `subdir`.
13
+ * - `snapshots` — the resolved snapshot chain, each with the `original`
14
+ * name (`lts-22.28`) and the `completed` url, size and sha256.
15
+ *
16
+ * The lock pins only the extra-deps: packages taken from the snapshot are not
17
+ * listed, because the snapshot url and digest already pin them. The snapshot
18
+ * is therefore recorded on the parent component rather than expanded.
19
+ *
20
+ * Hackage packages are identified with the registered `hackage` purl type
21
+ * (`pkg:hackage/<name>@<version>`).
22
+ */
23
+ /**
24
+ * Parse a Stack project from its lock file, with optional `stack.yaml`.
25
+ *
26
+ * @param {string} stackLockFile Path to `stack.yaml.lock` or `stack.lock`
27
+ * @param {string} [stackYamlFile] Path to `stack.yaml`, if present
28
+ * @returns {{ pkgList: object[], parentComponent: object, rootInputs: string[] }}
29
+ */
30
+ export declare function parseStackProject(stackLockFile: string, stackYamlFile?: string): {
31
+ pkgList: object[];
32
+ parentComponent: object;
33
+ rootInputs: string[];
34
+ };
35
+ //# sourceMappingURL=parsers-stack.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parsers-stack.d.ts","sourceRoot":"","sources":["../../../lib/ecosystems/parsers-stack.js"],"names":[],"mappings":"AAMA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,aAAa,EAJpC,MAIoC,EAAE,aAAa,AAH3D,CACA,EADQ,MAGmD,GAFjD;IAAE,OAAO,EAAE,MAAM,EAAE,CAAC;IAAC,eAAe,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,EAAE,CAAA;CAAE,CA0ChF"}
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Terraform and OpenTofu parser for `.terraform.lock.hcl`.
3
+ *
4
+ * The lock file pins every provider the configuration resolves to, with its
5
+ * exact version, the version constraints that produced it, and content
6
+ * hashes. It is written in a small, regular subset of HCL: provider blocks,
7
+ * `version` and `constraints` attributes, and a `hashes` list of prefixed
8
+ * digests. A line scanner is sufficient and avoids a general HCL parser.
9
+ *
10
+ * Provider addresses look like `registry.terraform.io/hashicorp/aws`; the
11
+ * registry host and namespace identify the provider upstream, so they are
12
+ * kept in the component group and a generic purl
13
+ * (`pkg:generic/<host>/<namespace>/<type>@<version>`), with the intended type
14
+ * recorded as a `cdx:purl:proposedType` property because no `terraform`
15
+ * purl type is registered.
16
+ *
17
+ * The two hash schemes in the `hashes` list mean different things. A `zh:`
18
+ * digest is a SHA-256 of the official `.zip` package as the registry indexes
19
+ * it, so it is the one a consumer can check an artifact against and the one
20
+ * emitted in the CycloneDX `hashes` array. An `h1:` digest is base64 over a
21
+ * hash of the package's *contents* rather than the archive, which lets
22
+ * Terraform verify an unpacked directory but makes it useless as an artifact
23
+ * checksum; it is kept as a property instead of being mislabelled SHA-256.
24
+ */
25
+ /**
26
+ * Parse a `.terraform.lock.hcl` file.
27
+ *
28
+ * @param {string} lockFile Path to the lock file
29
+ * @returns {{ pkgList: object[] }} Provider components
30
+ */
31
+ export declare function parseTerraformLockFile(lockFile: string): {
32
+ pkgList: object[];
33
+ };
34
+ //# sourceMappingURL=parsers-terraform.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parsers-terraform.d.ts","sourceRoot":"","sources":["../../../lib/ecosystems/parsers-terraform.js"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,QAAQ,EAHpC,MAGoC,GAFlC;IAAE,OAAO,EAAE,MAAM,EAAE,CAAA;CAAE,CAkEjC"}
@@ -71,9 +71,9 @@ export declare function createUVLock(basePath: string, options: Object): void;
71
71
  */
72
72
  export declare function getPipFrozenTree(basePath: string, reqOrSetupFile: string, tempVenvDir: string, parentComponent: Object, projectRoot: any, getTreeWithPluginFn: any): Object;
73
73
  export declare function getPipTreeForPackages(basePath: any, pkgList: any, tempVenvDir: any, parentComponent: any, getTreeWithPluginFn: any): {
74
- rootList?: undefined;
75
74
  dependenciesList?: undefined;
76
75
  failedPkgList?: undefined;
76
+ rootList?: undefined;
77
77
  } | {
78
78
  failedPkgList: any[];
79
79
  rootList: {
@@ -61,6 +61,39 @@ export declare function simplifyRubyVersion(version: string): string;
61
61
  * @returns {string} purl string
62
62
  */
63
63
  export declare function toGemPurl(name: string, version: string | undefined, platform: string | undefined): string;
64
+ /**
65
+ * Read the Ruby string literal at the start of `text`: a double or single
66
+ * quoted string, or a `%q`/`%Q`/`%` percent literal. Escaped delimiters and
67
+ * backslashes are unescaped; every other escape sequence is kept as written.
68
+ * An interpolation such as `#{spec.name}` is kept verbatim, including any
69
+ * quotes inside it.
70
+ *
71
+ * @param {string} text Source starting with the literal
72
+ * @returns {{value: string, interpolated: boolean, complete: boolean, rest: string} | undefined}
73
+ * The literal's value, whether it holds an interpolation, whether it was
74
+ * closed within `text`, and the source after it. Undefined when `text` does
75
+ * not start with a string literal.
76
+ */
77
+ export declare function readRubyStringLiteral(text: string): {
78
+ value: string;
79
+ interpolated: boolean;
80
+ complete: boolean;
81
+ rest: string;
82
+ } | undefined;
83
+ /**
84
+ * Read a Ruby list of strings as written for `authors`, `email`, or `licenses`:
85
+ * an array of string literals, a `%w[]` word array, or a single string. Array
86
+ * elements that are not string literals, such as constants, are skipped.
87
+ *
88
+ * @param {string} text Source of the value
89
+ * @returns {{values: string[], complete: boolean} | undefined} The strings,
90
+ * and whether the array was closed within `text`. Undefined when the value
91
+ * is an expression that cannot be read statically.
92
+ */
93
+ export declare function readRubyStringList(text: string): {
94
+ values: string[];
95
+ complete: boolean;
96
+ } | undefined;
64
97
  /**
65
98
  * Parse a single line from the `CHECKSUMS` section of a Gemfile.lock. Bundler
66
99
  * 2.5 onwards writes `name (version[-platform]) algo=digest[,algo=digest]`,
@@ -159,15 +192,35 @@ export declare function toGemModuleNames(name: any): string[];
159
192
  */
160
193
  export declare function collectGemModuleNames(rubyCommand: string, bundleCommand: string, gemHome: string, gemName: string, filePath: string): Array<string>;
161
194
  /**
162
- * Method to parse Gemspec file contents
195
+ * Method to parse Gemspec file contents.
196
+ *
197
+ * A source gemspec is Ruby code. The values that can be read without running
198
+ * it are string literals, lists of them, heredocs, and a version constant
199
+ * defined in the version file the gemspec requires. Anything else is left
200
+ * unresolved instead of being guessed.
201
+ *
202
+ * Bundler evaluates the gemspec of a project that uses the Gemfile `gemspec`
203
+ * directive, and locks the gem under `PATH remote: .`. Such a locked version
204
+ * can be supplied through `options.lockedVersions` and is used when the
205
+ * gemspec computes its version in a way that cannot be read statically.
163
206
  *
164
207
  * @param {string} gemspecData Gemspec data
165
208
  * @param {string} gemspecFile File name for evidence.
209
+ * @param {Object} [options] Parse options
210
+ * @param {Object<string, string>} [options.lockedVersions] Locked versions of
211
+ * the gems the project directory serves, by gem name
166
212
  */
167
- export declare function parseGemspecData(gemspecData: string, gemspecFile: string): Promise<any[]>;
213
+ export declare function parseGemspecData(gemspecData: string, gemspecFile: string, options?: {
214
+ lockedVersions?: Record<string, string>;
215
+ }): Promise<any[]>;
168
216
  /**
169
217
  * Method to parse Gemfile.lock
170
218
  *
219
+ * Besides the components and the dependency tree, the result lists as
220
+ * `projectGemRefs` the bom-refs of the gems served from the lockfile's own
221
+ * directory (`PATH` with `remote: .`), which is how Bundler records the gem a
222
+ * project builds when its Gemfile uses the `gemspec` directive.
223
+ *
171
224
  * @param {object} gemLockData Gemfile.lock data
172
225
  * @param {string} lockFile Lock file
173
226
  */
@@ -178,5 +231,93 @@ export declare function parseGemfileLockData(gemLockData: object, lockFile: stri
178
231
  dependsOn: any[];
179
232
  }[];
180
233
  rootList: any[];
234
+ projectGemRefs: any[];
181
235
  }>;
236
+ /**
237
+ * Describe the gem a project builds in its parent component.
238
+ *
239
+ * A gem project sees its own gem more than once: in its gemspec, in the `PATH`
240
+ * entry the Gemfile `gemspec` directive adds to its lockfile, and possibly as
241
+ * an installed copy. Each of them describes the project itself, so all are
242
+ * folded into the parent (discussion 4388). The parent takes the gem's
243
+ * identity, its descriptive metadata, and its `cdx:gem:*` properties; the
244
+ * dependency edges of the sightings move to the parent; and the sightings
245
+ * leave the component list, so the gem is never a dependency of itself.
246
+ *
247
+ * An explicit `--project-version` names the version of the parent. Otherwise
248
+ * the version of the gemspec, which may have come from the lockfile, is used.
249
+ *
250
+ * @param {object} parentComponent Parent component, updated in place
251
+ * @param {object} projectGem Component parsed from the root gemspec
252
+ * @param {object[]} pkgList Components
253
+ * @param {object[]} dependencies Dependency edges
254
+ * @param {string[]} rootList bom-refs of the direct dependencies
255
+ * @param {string[]} projectGemRefs bom-refs of the gems the lockfiles serve from the project directory
256
+ * @param {object} options CLI options
257
+ * @returns {{pkgList: object[], dependencies: object[], rootList: string[]}}
258
+ * The components, edges, and direct dependencies with the gem folded in
259
+ */
260
+ export declare function describeProjectGem(parentComponent: object, projectGem: object, pkgList: object[], dependencies: object[], rootList: string[], projectGemRefs: string[], options?: object): {
261
+ pkgList: object[];
262
+ dependencies: object[];
263
+ rootList: string[];
264
+ };
265
+ /**
266
+ * Point each gem resolved from the public RubyGems registry at its `.gem`
267
+ * tarball with a `distribution` external reference (discussion 4406).
268
+ *
269
+ * The registry API supplies `gem_uri` when it is reachable, but an offline
270
+ * scan — a dry run, an air-gapped host, or one that only consulted Bundler's
271
+ * local caches — has no way to learn it. For the public registry the URL is
272
+ * deterministic, so it is derived from the recorded `cdx:gem:remote` and the
273
+ * release identity instead. Gems from any other remote are left alone: a
274
+ * private mirror's layout is its own business.
275
+ *
276
+ * @param {Array} pkgList Gem components, enriched in place
277
+ * @returns {Array} The package list
278
+ */
279
+ export declare function addRubyGemsDistributionUrls(pkgList: any[]): any[];
280
+ /**
281
+ * Intersect Gem::Requirement strings into one `vers` range with the RubyGems
282
+ * versioning scheme, as the CycloneDX `versionRange` requires. `>= 2.3` and
283
+ * `>= 3.3` intersect to `vers:gem/>=3.3`, and `~> 3.1` becomes
284
+ * `vers:gem/>=3.1|<4`, since vers has no pessimistic operator.
285
+ *
286
+ * @param {string[]} requirements Requirement strings, each possibly holding
287
+ * several comma separated constraints
288
+ * @returns {string|null|undefined} The range, `null` when the requirements
289
+ * exclude each other, or undefined when none of them could be read
290
+ */
291
+ export declare function rubyRequirementToVers(requirements: string[]): string | null | undefined;
292
+ /**
293
+ * Describe the Ruby runtime the gems require as one external `platform`
294
+ * component, and make the components that declare a `required_ruby_version`
295
+ * depend on it (discussion 4409).
296
+ *
297
+ * The component stands for the Ruby the bundle as a whole runs on, so its
298
+ * `versionRange` is the intersection of every requirement that could be read,
299
+ * in the `vers` syntax CycloneDX mandates for the field. Each component's own
300
+ * requirement stays in its `cdx:gem:rubyVersionSpecifiers` property. One
301
+ * runtime component per distinct requirement would describe the same
302
+ * interpreter many times over: a modest bundle spells `>= 2.x` a dozen ways.
303
+ *
304
+ * The type is `platform`, the CycloneDX type for a runtime environment that
305
+ * interprets software, and the one cdxgen gives the Ruby it finds in the
306
+ * build environment. The purl names no version, since a range is not one.
307
+ *
308
+ * `isExternal` and `versionRange` are CycloneDX 1.7 fields, and without them
309
+ * the component would claim the product bundles its interpreter, so the caller
310
+ * decides whether the BOM should carry it at all.
311
+ *
312
+ * @param {Array} pkgList Components
313
+ * @param {object} parentComponent The metadata.component, when the project is
314
+ * itself a gem
315
+ * @param {Array} dependencies Dependency edges
316
+ * @returns {{pkgList: Array, dependencies: Array}} Components and edges with
317
+ * the runtime component added
318
+ */
319
+ export declare function addRubyRuntimeComponent(pkgList: any[], parentComponent: object, dependencies: any[]): {
320
+ pkgList: any[];
321
+ dependencies: any[];
322
+ };
182
323
  //# sourceMappingURL=rubyutils.d.ts.map