@cdxgen/cdxgen 13.4.0 → 13.6.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 (305) hide show
  1. package/README.md +9 -9
  2. package/bin/cdxgen-secure.js +15 -0
  3. package/bin/cdxgen.js +29 -5
  4. package/bin/evinse.js +8 -0
  5. package/bin/hbom.js +15 -7
  6. package/bin/repl.js +29 -0
  7. package/bin/validate.js +6 -0
  8. package/data/cbomosdb-queries.json +13 -1
  9. package/data/component-tags.json +8 -0
  10. package/data/license-aliases.json +24 -2
  11. package/data/queries-darwin.json +25 -1
  12. package/data/queries-win.json +19 -1
  13. package/data/queries.json +41 -0
  14. package/data/remediations.json +407 -1
  15. package/data/rules/ai-bom.yaml +1 -1
  16. package/data/rules/brotli-decoder.yaml +107 -0
  17. package/data/rules/cbom-security.yaml +235 -4
  18. package/data/rules/go-binaries.yaml +46 -0
  19. package/data/rules/golem-go.yaml +80 -0
  20. package/data/rules/hbom-compliance.yaml +40 -22
  21. package/data/rules/hbom-performance.yaml +7 -1
  22. package/data/rules/host-topology.yaml +1 -1
  23. package/data/rules/obom-runtime.yaml +31 -2
  24. package/data/rules/php-runtime.yaml +143 -0
  25. package/data/rules/vscode-extensions.yaml +75 -0
  26. package/data/spdx-license-list.json +121 -7
  27. package/data/spdx-licenses.json +69 -0
  28. package/data/spdx.schema.json +845 -2
  29. package/lib/audit/index.js +14 -0
  30. package/lib/cli/bomAssembly.js +120 -6
  31. package/lib/cli/cliOptions.js +110 -3
  32. package/lib/cli/index.js +182 -6
  33. package/lib/cli/jsBom.js +153 -64
  34. package/lib/cli/jvmBom.js +363 -66
  35. package/lib/cli/managedBom.js +853 -87
  36. package/lib/cli/nativeBom.js +267 -33
  37. package/lib/core/boundedFile.js +344 -0
  38. package/lib/core/brotliProbe.js +182 -0
  39. package/lib/core/env.js +38 -8
  40. package/lib/core/fs.js +40 -19
  41. package/lib/core/httpClient.js +172 -46
  42. package/lib/core/lockPaths.js +38 -0
  43. package/lib/core/paths.js +24 -1
  44. package/lib/core/processTree.js +5 -0
  45. package/lib/core/projectConfig.js +1 -0
  46. package/lib/core/projectTooling.js +97 -0
  47. package/lib/core/propertySanitizer.js +72 -0
  48. package/lib/core/toolRegistry.js +170 -0
  49. package/lib/ecosystems/cppEvidence.js +263 -106
  50. package/lib/ecosystems/cppIncludeResolver.js +16 -5
  51. package/lib/ecosystems/ecosystems.js +25 -10
  52. package/lib/ecosystems/gemHostProbe.js +301 -0
  53. package/lib/ecosystems/golem.js +550 -6
  54. package/lib/ecosystems/gradleutils.js +858 -244
  55. package/lib/ecosystems/parsers-bazel.js +107 -6
  56. package/lib/ecosystems/parsers-dotnet.js +117 -18
  57. package/lib/ecosystems/parsers-go.js +1090 -367
  58. package/lib/ecosystems/parsers-js.js +505 -22
  59. package/lib/ecosystems/parsers-jvm.js +259 -17
  60. package/lib/ecosystems/parsers-misc.js +438 -64
  61. package/lib/ecosystems/parsers-python.js +100 -12
  62. package/lib/ecosystems/pythonutils.js +128 -2
  63. package/lib/ecosystems/rubyutils.js +544 -34
  64. package/lib/ecosystems/rusi.js +10 -0
  65. package/lib/ecosystems/scalacliutils.js +4 -1
  66. package/lib/ecosystems/scalasem.js +798 -151
  67. package/lib/ecosystems/vendoredCode.js +237 -3
  68. package/lib/ecosystems/venvProbe.js +360 -0
  69. package/lib/evinser/evinser.js +472 -61
  70. package/lib/evinser/swiftsem.js +68 -5
  71. package/lib/helpers/agenticToolutils.js +413 -93
  72. package/lib/helpers/vsixutils.js +1574 -315
  73. package/lib/inventory/agentSkillSpec.js +17 -0
  74. package/lib/inventory/apkInstalledDb.js +243 -0
  75. package/lib/inventory/atomUtils.js +110 -0
  76. package/lib/inventory/auditCategories.js +3 -3
  77. package/lib/inventory/brotliDecoder.js +142 -0
  78. package/lib/inventory/buildToolRateLimit.js +1 -1
  79. package/lib/inventory/cacheDir.js +52 -9
  80. package/lib/inventory/cbomutils.js +56 -7
  81. package/lib/inventory/certificates.js +2371 -0
  82. package/lib/inventory/communityAiConfigParser.js +4 -9
  83. package/lib/inventory/deps.js +41 -4
  84. package/lib/inventory/display.js +200 -3
  85. package/lib/inventory/dosai.js +639 -63
  86. package/lib/inventory/dotnetRuntime.js +217 -0
  87. package/lib/inventory/dynamic.js +45 -3
  88. package/lib/inventory/envcontext.js +475 -18
  89. package/lib/inventory/evidenceUtils.js +447 -23
  90. package/lib/inventory/fetchBatch.js +1 -1
  91. package/lib/inventory/formulationParsers.js +32 -3
  92. package/lib/inventory/goBuildInfo.js +140 -0
  93. package/lib/inventory/gtfobins.js +13 -0
  94. package/lib/inventory/hbom.js +67 -7
  95. package/lib/inventory/hbomAnalysis.js +16 -0
  96. package/lib/inventory/hostRuntimeProbe.js +686 -0
  97. package/lib/inventory/hostTopology.js +21 -0
  98. package/lib/inventory/jvmLocalRepos.js +9 -2
  99. package/lib/inventory/jvmToolEnv.js +29 -0
  100. package/lib/inventory/licenseEnhancer.js +12 -0
  101. package/lib/inventory/mavenCentralMirror.js +534 -0
  102. package/lib/inventory/nodeBuildInfo.js +218 -0
  103. package/lib/inventory/nodeHostProbe.js +202 -0
  104. package/lib/inventory/osPackagePurl.js +244 -0
  105. package/lib/inventory/osPackageResolver.js +271 -87
  106. package/lib/inventory/osinfo.js +79 -31
  107. package/lib/inventory/osqueryTransform.js +114 -5
  108. package/lib/inventory/phpBuildInfo.js +438 -0
  109. package/lib/inventory/phpHostProbe.js +185 -0
  110. package/lib/inventory/rootfsCerts.js +426 -0
  111. package/lib/inventory/rubyBuildInfo.js +972 -0
  112. package/lib/inventory/rubyHostProbe.js +218 -0
  113. package/lib/inventory/scalaCoords.js +4 -3
  114. package/lib/inventory/scalaDedupe.js +440 -0
  115. package/lib/inventory/source.js +256 -5
  116. package/lib/inventory/spdx.js +144 -0
  117. package/lib/inventory/traceRunner.js +5 -1
  118. package/lib/inventory/tracedCrypto.js +129 -0
  119. package/lib/managers/binary.js +866 -186
  120. package/lib/managers/docker.js +245 -12
  121. package/lib/parsers/email.js +277 -0
  122. package/lib/parsers/largeJson.js +62 -13
  123. package/lib/parsers/vscodeExtensionId.js +183 -0
  124. package/lib/server/server.js +198 -2
  125. package/lib/stages/postgen/annotator.js +17 -1
  126. package/lib/stages/postgen/introspection/reflect.js +4 -1
  127. package/lib/stages/postgen/postgen.js +5 -5
  128. package/lib/stages/postgen/ruleEngine.js +71 -6
  129. package/lib/stages/postgen/specVersionCompat.js +30 -0
  130. package/lib/stages/pregen/envAudit.js +1 -0
  131. package/lib/stages/pregen/pregen.js +231 -62
  132. package/lib/validator/bomValidator.js +32 -6
  133. package/lib/validator/generated/runtime.mjs +13 -0
  134. package/lib/validator/generated/validate-1.6.mjs +27 -8
  135. package/lib/validator/generated/validate-1.7.mjs +32 -13
  136. package/lib/validator/generated/validate-2.0.mjs +31 -12
  137. package/lib/validator/index.js +1 -1
  138. package/package.json +19 -18
  139. package/types/bin/cdxgen-secure.d.ts +3 -0
  140. package/types/bin/cdxgen-secure.d.ts.map +1 -0
  141. package/types/bin/repl.d.ts.map +1 -1
  142. package/types/lib/audit/index.d.ts.map +1 -1
  143. package/types/lib/cli/bomAssembly.d.ts +22 -3
  144. package/types/lib/cli/bomAssembly.d.ts.map +1 -1
  145. package/types/lib/cli/cliOptions.d.ts +43 -0
  146. package/types/lib/cli/cliOptions.d.ts.map +1 -1
  147. package/types/lib/cli/index.d.ts.map +1 -1
  148. package/types/lib/cli/jsBom.d.ts +1 -17
  149. package/types/lib/cli/jsBom.d.ts.map +1 -1
  150. package/types/lib/cli/jvmBom.d.ts +20 -0
  151. package/types/lib/cli/jvmBom.d.ts.map +1 -1
  152. package/types/lib/cli/managedBom.d.ts.map +1 -1
  153. package/types/lib/cli/nativeBom.d.ts.map +1 -1
  154. package/types/lib/core/boundedFile.d.ts +70 -0
  155. package/types/lib/core/boundedFile.d.ts.map +1 -0
  156. package/types/lib/core/brotliProbe.d.ts +37 -0
  157. package/types/lib/core/brotliProbe.d.ts.map +1 -0
  158. package/types/lib/core/env.d.ts +22 -2
  159. package/types/lib/core/env.d.ts.map +1 -1
  160. package/types/lib/core/fs.d.ts.map +1 -1
  161. package/types/lib/core/httpClient.d.ts +24 -0
  162. package/types/lib/core/httpClient.d.ts.map +1 -1
  163. package/types/lib/core/lockPaths.d.ts +19 -0
  164. package/types/lib/core/lockPaths.d.ts.map +1 -0
  165. package/types/lib/core/processTree.d.ts +2 -0
  166. package/types/lib/core/processTree.d.ts.map +1 -1
  167. package/types/lib/core/projectConfig.d.ts.map +1 -1
  168. package/types/lib/core/projectTooling.d.ts +41 -0
  169. package/types/lib/core/projectTooling.d.ts.map +1 -0
  170. package/types/lib/core/propertySanitizer.d.ts +26 -0
  171. package/types/lib/core/propertySanitizer.d.ts.map +1 -1
  172. package/types/lib/core/toolRegistry.d.ts +36 -0
  173. package/types/lib/core/toolRegistry.d.ts.map +1 -0
  174. package/types/lib/ecosystems/cppEvidence.d.ts +40 -13
  175. package/types/lib/ecosystems/cppEvidence.d.ts.map +1 -1
  176. package/types/lib/ecosystems/cppIncludeResolver.d.ts +2 -1
  177. package/types/lib/ecosystems/cppIncludeResolver.d.ts.map +1 -1
  178. package/types/lib/ecosystems/ecosystems.d.ts.map +1 -1
  179. package/types/lib/ecosystems/gemHostProbe.d.ts +28 -0
  180. package/types/lib/ecosystems/gemHostProbe.d.ts.map +1 -0
  181. package/types/lib/ecosystems/golem.d.ts +81 -1
  182. package/types/lib/ecosystems/golem.d.ts.map +1 -1
  183. package/types/lib/ecosystems/gradleutils.d.ts +57 -21
  184. package/types/lib/ecosystems/gradleutils.d.ts.map +1 -1
  185. package/types/lib/ecosystems/parsers-bazel.d.ts.map +1 -1
  186. package/types/lib/ecosystems/parsers-dotnet.d.ts +40 -4
  187. package/types/lib/ecosystems/parsers-dotnet.d.ts.map +1 -1
  188. package/types/lib/ecosystems/parsers-go.d.ts +85 -13
  189. package/types/lib/ecosystems/parsers-go.d.ts.map +1 -1
  190. package/types/lib/ecosystems/parsers-js.d.ts +17 -20
  191. package/types/lib/ecosystems/parsers-js.d.ts.map +1 -1
  192. package/types/lib/ecosystems/parsers-jvm.d.ts +28 -2
  193. package/types/lib/ecosystems/parsers-jvm.d.ts.map +1 -1
  194. package/types/lib/ecosystems/parsers-misc.d.ts +37 -58
  195. package/types/lib/ecosystems/parsers-misc.d.ts.map +1 -1
  196. package/types/lib/ecosystems/parsers-python.d.ts +14 -3
  197. package/types/lib/ecosystems/parsers-python.d.ts.map +1 -1
  198. package/types/lib/ecosystems/pythonutils.d.ts +19 -1
  199. package/types/lib/ecosystems/pythonutils.d.ts.map +1 -1
  200. package/types/lib/ecosystems/rubyutils.d.ts +144 -12
  201. package/types/lib/ecosystems/rubyutils.d.ts.map +1 -1
  202. package/types/lib/ecosystems/rusi.d.ts.map +1 -1
  203. package/types/lib/ecosystems/scalacliutils.d.ts.map +1 -1
  204. package/types/lib/ecosystems/scalasem.d.ts.map +1 -1
  205. package/types/lib/ecosystems/vendoredCode.d.ts +26 -0
  206. package/types/lib/ecosystems/vendoredCode.d.ts.map +1 -1
  207. package/types/lib/ecosystems/venvProbe.d.ts +40 -0
  208. package/types/lib/ecosystems/venvProbe.d.ts.map +1 -0
  209. package/types/lib/evinser/evinser.d.ts +88 -8
  210. package/types/lib/evinser/evinser.d.ts.map +1 -1
  211. package/types/lib/evinser/swiftsem.d.ts +10 -0
  212. package/types/lib/evinser/swiftsem.d.ts.map +1 -1
  213. package/types/lib/inventory/agentSkillSpec.d.ts +13 -0
  214. package/types/lib/inventory/agentSkillSpec.d.ts.map +1 -0
  215. package/types/lib/inventory/apkInstalledDb.d.ts +42 -0
  216. package/types/lib/inventory/apkInstalledDb.d.ts.map +1 -0
  217. package/types/lib/inventory/atomUtils.d.ts +33 -0
  218. package/types/lib/inventory/atomUtils.d.ts.map +1 -1
  219. package/types/lib/inventory/brotliDecoder.d.ts +58 -0
  220. package/types/lib/inventory/brotliDecoder.d.ts.map +1 -0
  221. package/types/lib/inventory/cacheDir.d.ts +12 -4
  222. package/types/lib/inventory/cacheDir.d.ts.map +1 -1
  223. package/types/lib/inventory/cbomutils.d.ts +17 -0
  224. package/types/lib/inventory/cbomutils.d.ts.map +1 -1
  225. package/types/lib/inventory/certificates.d.ts +205 -0
  226. package/types/lib/inventory/certificates.d.ts.map +1 -0
  227. package/types/lib/inventory/communityAiConfigParser.d.ts.map +1 -1
  228. package/types/lib/inventory/deps.d.ts +2 -1
  229. package/types/lib/inventory/deps.d.ts.map +1 -1
  230. package/types/lib/inventory/display.d.ts +18 -0
  231. package/types/lib/inventory/display.d.ts.map +1 -1
  232. package/types/lib/inventory/dosai.d.ts +162 -7
  233. package/types/lib/inventory/dosai.d.ts.map +1 -1
  234. package/types/lib/inventory/dotnetRuntime.d.ts +44 -0
  235. package/types/lib/inventory/dotnetRuntime.d.ts.map +1 -0
  236. package/types/lib/inventory/dynamic.d.ts +6 -1
  237. package/types/lib/inventory/dynamic.d.ts.map +1 -1
  238. package/types/lib/inventory/envcontext.d.ts +92 -8
  239. package/types/lib/inventory/envcontext.d.ts.map +1 -1
  240. package/types/lib/inventory/evidenceUtils.d.ts +29 -10
  241. package/types/lib/inventory/evidenceUtils.d.ts.map +1 -1
  242. package/types/lib/inventory/formulationParsers.d.ts.map +1 -1
  243. package/types/lib/inventory/goBuildInfo.d.ts +10 -0
  244. package/types/lib/inventory/goBuildInfo.d.ts.map +1 -0
  245. package/types/lib/inventory/gtfobins.d.ts.map +1 -1
  246. package/types/lib/inventory/hbom.d.ts.map +1 -1
  247. package/types/lib/inventory/hbomAnalysis.d.ts +10 -0
  248. package/types/lib/inventory/hbomAnalysis.d.ts.map +1 -1
  249. package/types/lib/inventory/hostRuntimeProbe.d.ts +44 -0
  250. package/types/lib/inventory/hostRuntimeProbe.d.ts.map +1 -0
  251. package/types/lib/inventory/hostTopology.d.ts.map +1 -1
  252. package/types/lib/inventory/jvmToolEnv.d.ts +12 -0
  253. package/types/lib/inventory/jvmToolEnv.d.ts.map +1 -1
  254. package/types/lib/inventory/licenseEnhancer.d.ts.map +1 -1
  255. package/types/lib/inventory/mavenCentralMirror.d.ts +170 -0
  256. package/types/lib/inventory/mavenCentralMirror.d.ts.map +1 -0
  257. package/types/lib/inventory/nodeBuildInfo.d.ts +95 -0
  258. package/types/lib/inventory/nodeBuildInfo.d.ts.map +1 -0
  259. package/types/lib/inventory/nodeHostProbe.d.ts +15 -0
  260. package/types/lib/inventory/nodeHostProbe.d.ts.map +1 -0
  261. package/types/lib/inventory/osPackagePurl.d.ts +99 -0
  262. package/types/lib/inventory/osPackagePurl.d.ts.map +1 -0
  263. package/types/lib/inventory/osPackageResolver.d.ts +44 -2
  264. package/types/lib/inventory/osPackageResolver.d.ts.map +1 -1
  265. package/types/lib/inventory/osinfo.d.ts +31 -6
  266. package/types/lib/inventory/osinfo.d.ts.map +1 -1
  267. package/types/lib/inventory/osqueryTransform.d.ts +51 -0
  268. package/types/lib/inventory/osqueryTransform.d.ts.map +1 -1
  269. package/types/lib/inventory/phpBuildInfo.d.ts +142 -0
  270. package/types/lib/inventory/phpBuildInfo.d.ts.map +1 -0
  271. package/types/lib/inventory/phpHostProbe.d.ts +35 -0
  272. package/types/lib/inventory/phpHostProbe.d.ts.map +1 -0
  273. package/types/lib/inventory/rootfsCerts.d.ts +27 -0
  274. package/types/lib/inventory/rootfsCerts.d.ts.map +1 -0
  275. package/types/lib/inventory/rubyBuildInfo.d.ts +271 -0
  276. package/types/lib/inventory/rubyBuildInfo.d.ts.map +1 -0
  277. package/types/lib/inventory/rubyHostProbe.d.ts +47 -0
  278. package/types/lib/inventory/rubyHostProbe.d.ts.map +1 -0
  279. package/types/lib/inventory/source.d.ts +38 -0
  280. package/types/lib/inventory/source.d.ts.map +1 -1
  281. package/types/lib/inventory/spdx.d.ts +15 -0
  282. package/types/lib/inventory/spdx.d.ts.map +1 -1
  283. package/types/lib/inventory/traceRunner.d.ts +4 -1
  284. package/types/lib/inventory/traceRunner.d.ts.map +1 -1
  285. package/types/lib/inventory/tracedCrypto.d.ts +22 -0
  286. package/types/lib/inventory/tracedCrypto.d.ts.map +1 -1
  287. package/types/lib/managers/binary.d.ts +10 -0
  288. package/types/lib/managers/binary.d.ts.map +1 -1
  289. package/types/lib/managers/docker.d.ts +24 -0
  290. package/types/lib/managers/docker.d.ts.map +1 -1
  291. package/types/lib/parsers/email.d.ts +19 -0
  292. package/types/lib/parsers/email.d.ts.map +1 -0
  293. package/types/lib/parsers/largeJson.d.ts +17 -3
  294. package/types/lib/parsers/largeJson.d.ts.map +1 -1
  295. package/types/lib/server/server.d.ts +8 -0
  296. package/types/lib/server/server.d.ts.map +1 -1
  297. package/types/lib/stages/postgen/annotator.d.ts.map +1 -1
  298. package/types/lib/stages/postgen/introspection/reflect.d.ts.map +1 -1
  299. package/types/lib/stages/postgen/ruleEngine.d.ts +7 -4
  300. package/types/lib/stages/postgen/ruleEngine.d.ts.map +1 -1
  301. package/types/lib/stages/postgen/specVersionCompat.d.ts.map +1 -1
  302. package/types/lib/stages/pregen/envAudit.d.ts.map +1 -1
  303. package/types/lib/stages/pregen/pregen.d.ts +26 -9
  304. package/types/lib/stages/pregen/pregen.d.ts.map +1 -1
  305. package/types/lib/validator/bomValidator.d.ts.map +1 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rootfsCerts.d.ts","sourceRoot":"","sources":["../../../lib/inventory/rootfsCerts.js"],"names":[],"mappings":"AAqBA,eAAO,MAAM,kBAAkB;;;;;EAK7B,CAAC;AA0IH;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,yBAAyB,CAAC,OAAO,EAJtC,MAIsC,EAAE,MAAM,AAHtD,CACA,EADQ,MAGmD,GAFjD;IAAC,UAAU,EAAE,MAAM,EAAE,CAAC;IAAC,YAAY,EAAE,MAAM,EAAE,CAAC;IAAC,QAAQ,EAAE,MAAM,EAAE,CAAA;CAAC,CA6N9E"}
@@ -0,0 +1,271 @@
1
+ /**
2
+ * The most Ruby-named files one scan opens in search of a build version.
3
+ *
4
+ * @type {number}
5
+ */
6
+ export declare const MAX_RUBY_PROBES: number;
7
+ /**
8
+ * Parse an MRI version and normalize a pre-release to the hyphenated form the
9
+ * release tarballs use: `3.4.0preview2` becomes `3.4.0-preview2`.
10
+ *
11
+ * @param {string} text candidate version, without a patchlevel
12
+ * @returns {string|undefined} the version, or undefined
13
+ */
14
+ export declare function parseRubyVersion(text: string): string | undefined;
15
+ /**
16
+ * Read the first line `ruby -v` prints, or the description compiled into
17
+ * libruby, for MRI, JRuby and TruffleRuby:
18
+ * - `ruby 3.3.6 (2024-11-05 revision 75015d4c1f) [x86_64-linux]`
19
+ * - `ruby 2.7.8p225 (2023-03-30 revision 1f4d455848) [x86_64-linux]`
20
+ * - `ruby 3.4.0preview2 (2024-10-07 master 32c733f57b) +PRISM [x86_64-linux]`
21
+ * - `jruby 9.4.8.0 (3.1.4) 2024-07-02 4d41e55a67 OpenJDK 64-Bit ...`
22
+ * - `truffleruby 24.1.0, like ruby 3.2.4, Oracle GraalVM Native [x86_64-linux]`
23
+ *
24
+ * @param {string} text description line
25
+ * @returns {{engine: string, version: string, patchlevel?: string,
26
+ * rubyVersion?: string, platform?: string}|undefined} engine is `ruby`,
27
+ * `jruby` or `truffleruby`; for the last two, rubyVersion is the Ruby
28
+ * language version the engine implements
29
+ */
30
+ export declare function parseRubyDescription(text: string): {
31
+ engine: string;
32
+ version: string;
33
+ patchlevel?: string;
34
+ rubyVersion?: string;
35
+ platform?: string;
36
+ } | undefined;
37
+ /**
38
+ * Read the entries of an rbconfig.rb that identify a build. Only literal
39
+ * `CONFIG["KEY"] = "value"` lines are read; Ruby is never evaluated.
40
+ *
41
+ * @param {string} text rbconfig.rb contents
42
+ * @returns {{version: string, patchlevel?: string, abi?: string,
43
+ * arch?: string, baseName?: string}|undefined}
44
+ */
45
+ export declare function parseRbConfig(text: string): {
46
+ version: string;
47
+ patchlevel?: string;
48
+ abi?: string;
49
+ arch?: string;
50
+ baseName?: string;
51
+ } | undefined;
52
+ /**
53
+ * Whether a file name is one a Ruby interpreter is installed under: `ruby`,
54
+ * a versioned `ruby3.3` as distros and `--program-suffix` builds name it,
55
+ * `ruby.exe` and `rubyw.exe`.
56
+ *
57
+ * @param {string} fileName basename or path of the candidate
58
+ * @returns {boolean}
59
+ */
60
+ export declare function isRubyBinaryName(fileName: string): boolean;
61
+ /**
62
+ * Whether a file name is the shared Ruby library: libruby.so.3.3.6, Debian's
63
+ * libruby-3.1.so.3.1.2,
64
+ * libruby.3.3.dylib, or the RubyInstaller's x64-ucrt-ruby340.dll.
65
+ *
66
+ * @param {string} fileName basename or path of the candidate
67
+ * @returns {boolean}
68
+ */
69
+ export declare function isLibrubyName(fileName: string): boolean;
70
+ /**
71
+ * The version a libruby soname spells, libruby.so.3.3.6 -> 3.3.6.
72
+ *
73
+ * @param {string} fileName basename or path
74
+ * @returns {string|undefined}
75
+ */
76
+ export declare function versionFromLibrubyName(fileName: string): string | undefined;
77
+ /**
78
+ * The install prefix of a file under bin, sbin or lib: /usr/local/bin/ruby ->
79
+ * /usr/local, C:\Ruby34-x64\bin\ruby.exe -> C:\Ruby34-x64.
80
+ *
81
+ * @param {string} absPath absolute path
82
+ * @returns {string|undefined}
83
+ */
84
+ export declare function rubyInstallPrefix(absPath: string): string | undefined;
85
+ /**
86
+ * The rbconfig.rb files an install prefix holds, at most a few levels down:
87
+ * <prefix>/lib/ruby/<abi>/<arch>/rbconfig.rb, and the Debian layout
88
+ * <prefix>/lib/<triplet>/ruby/<abi>/rbconfig.rb.
89
+ *
90
+ * @param {string} prefix install prefix
91
+ * @returns {string[]} absolute paths
92
+ */
93
+ export declare function findRbConfigFiles(prefix: string): string[];
94
+ /**
95
+ * Find the description compiled into a file, `ruby 3.3.6 (2024-11-05 ...`.
96
+ *
97
+ * @param {string} absPath absolute path of a ruby binary or libruby
98
+ * @param {string|undefined} rootDir extracted root
99
+ * @returns {ReturnType<typeof parseRubyDescription>}
100
+ */
101
+ export declare function readRubyDescription(absPath: string, rootDir: string | undefined): ReturnType<typeof parseRubyDescription>;
102
+ /**
103
+ * Read the Ruby build version of a ruby binary or libruby.
104
+ *
105
+ * @param {string} absPath absolute path of the candidate
106
+ * @param {string|undefined} rootDir extracted root, when the file came from one
107
+ * @returns {{version: string, source: string, patchlevel?: string,
108
+ * abi?: string, arch?: string}|undefined} source is `rbconfig`, `binary`
109
+ * or `soname`
110
+ */
111
+ export declare function readRubyBuildVersion(absPath: string, rootDir: string | undefined): {
112
+ version: string;
113
+ source: string;
114
+ patchlevel?: string;
115
+ abi?: string;
116
+ arch?: string;
117
+ } | undefined;
118
+ /**
119
+ * The CPE that lets a downstream scanner match an interpreter version. NVD
120
+ * names MRI ruby-lang:ruby and keeps a pre-release in the update field, as in
121
+ * cpe:2.3:a:ruby-lang:ruby:3.4.0:preview1:*:*:*:*:*:*.
122
+ *
123
+ * @param {string} version interpreter version
124
+ * @param {string} [engine="ruby"] `ruby` or `jruby`
125
+ * @returns {string|undefined} CPE 2.3 string, or undefined for an engine NVD
126
+ * does not name
127
+ */
128
+ export declare function rubyCpe(version: string, engine?: string): string | undefined;
129
+ /**
130
+ * A Ruby runtime is one `platform` component per distinct engine and version,
131
+ * like the PHP and Node.js runtime components. Its identity is
132
+ * `pkg:generic/ruby` (or `jruby`, `truffleruby`).
133
+ *
134
+ * @param {string} version interpreter version
135
+ * @param {Object} [options] options
136
+ * @param {boolean} [options.withCpe=true] false for a Ruby a distro packaged,
137
+ * which backports fixes under its old upstream version
138
+ * @param {string} [options.engine="ruby"] `ruby`, `jruby` or `truffleruby`
139
+ * @returns {Object} component with `purl`, `bom-ref` and, when one applies, `cpe`
140
+ */
141
+ export declare function createRubyRuntimeComponent(version: string, { withCpe, engine }?: {
142
+ withCpe?: boolean;
143
+ engine?: string;
144
+ }): Object;
145
+ /**
146
+ * The bom-ref of the runtime component for a version.
147
+ *
148
+ * @param {string} version interpreter version
149
+ * @param {string} [engine="ruby"] engine
150
+ * @returns {string|undefined} bom-ref, which is the runtime's purl
151
+ */
152
+ export declare function rubyRuntimeRef(version: string, engine?: string): string | undefined;
153
+ /**
154
+ * The properties a Ruby file component carries once its build is known. They
155
+ * belong on unpackaged `file` components only: a package-owned Ruby is
156
+ * identified by its package.
157
+ *
158
+ * @param {{version: string, source: string, patchlevel?: string, abi?: string, arch?: string}} build
159
+ * result of readRubyBuildVersion
160
+ * @returns {{name: string, value: string}[]} properties to append
161
+ */
162
+ export declare function rubyBuildProperties(build: {
163
+ version: string;
164
+ source: string;
165
+ patchlevel?: string;
166
+ abi?: string;
167
+ arch?: string;
168
+ }): {
169
+ name: string;
170
+ value: string;
171
+ }[];
172
+ /**
173
+ * Start collecting the runtime components and edges of one scan.
174
+ *
175
+ * @returns {{runtimeComponents: Object[], dependencies: Object[], runtimeRefs: Set<string>}}
176
+ */
177
+ export declare function createRubyRuntimeInventory(): {
178
+ runtimeComponents: Object[];
179
+ dependencies: Object[];
180
+ runtimeRefs: Set<string>;
181
+ };
182
+ /**
183
+ * Tag a Ruby file component with its build facts and link it to the runtime
184
+ * component of its version, creating that component on first use. Mutates the
185
+ * component in place.
186
+ *
187
+ * @param {{runtimeComponents: Object[], dependencies: Object[], runtimeRefs: Set<string>}} inventory
188
+ * accumulator from createRubyRuntimeInventory
189
+ * @param {Object} component file component, with a `properties` array
190
+ * @param {{version: string, source: string, patchlevel?: string, abi?: string, arch?: string}} build
191
+ * result of readRubyBuildVersion
192
+ */
193
+ export declare function attachRubyBuild(inventory: {
194
+ runtimeComponents: Object[];
195
+ dependencies: Object[];
196
+ runtimeRefs: Set<string>;
197
+ }, component: Object, build: {
198
+ version: string;
199
+ source: string;
200
+ patchlevel?: string;
201
+ abi?: string;
202
+ arch?: string;
203
+ }): void;
204
+ /**
205
+ * The upstream Ruby version an OS package carries: 1:3.1.2-7+deb12u1 -> 3.1.2,
206
+ * 3.3.10-r0 -> 3.3.10, 3.0.7-168.el9_8 -> 3.0.7, 3.4.8_1 -> 3.4.8, and the
207
+ * Chocolatey 3.4.10.1 -> 3.4.10.
208
+ *
209
+ * @param {string} version package version
210
+ * @param {string} [purlType] purl type of the package
211
+ * @returns {string|undefined}
212
+ */
213
+ export declare function upstreamRubyVersion(version: string, purlType?: string): string | undefined;
214
+ /**
215
+ * Describe the Ruby an OS package installed with its upstream identity,
216
+ * `pkg:generic/ruby@<upstream>`, so a BOM names the interpreter both ways. The
217
+ * component of a distro package carries no CPE, since distros backport fixes
218
+ * under their old upstream version; Homebrew and Chocolatey ship the upstream
219
+ * release, so theirs does. `cdx:os:installedBy` names the package to judge it
220
+ * by.
221
+ *
222
+ * @param {Object[]} components BOM components, OS packages among them
223
+ * @returns {Object[]} runtime components to add, one per distinct version
224
+ */
225
+ export declare function deriveOsPackagedRubyRuntimes(components: Object[]): Object[];
226
+ /**
227
+ * Where the default gems of an install live: the gemspec paths
228
+ * <prefix>/lib/ruby/gems/<abi>/specifications/default/*.gemspec.
229
+ *
230
+ * @param {string} gemspecPath path of a gemspec, either separator
231
+ * @returns {{prefix: string, abi: string}|undefined} the install prefix and
232
+ * ABI, when the gemspec is a default gem of a lib/ruby/gems tree
233
+ */
234
+ export declare function defaultGemInstall(gemspecPath: string): {
235
+ prefix: string;
236
+ abi: string;
237
+ } | undefined;
238
+ /**
239
+ * Whether a path lies inside an installed gem's own directory,
240
+ * <gem home>/gems/<name>-<version>/..., beside the specifications directory of
241
+ * that gem home. The lockfiles, manifests and nested gemspecs there belong to
242
+ * the gem's own development, not to anything installed.
243
+ *
244
+ * Only the part of the path from the scanned directory down counts, so a scan
245
+ * of one installed gem (`cdxgen /usr/local/bundle/gems/rails-7.1.0`) still
246
+ * reads that gem's files. The scanned directory may itself be the `gems`
247
+ * directory, as when an image scan reads each gem home on its own.
248
+ *
249
+ * @param {string} filePath absolute path, either separator
250
+ * @param {function(string): boolean} exists existence check
251
+ * @param {string} [scanRoot] the directory the scan started from
252
+ * @returns {boolean}
253
+ */
254
+ export declare function isInsideInstalledGem(filePath: string, exists: Function, scanRoot?: string): boolean;
255
+ /**
256
+ * Link the default gems of an unpackaged Ruby to the runtime they ship with.
257
+ * The runtime is known from its `file` components, which carry the build
258
+ * version and the path they were found at; a default gem belongs to the
259
+ * runtime installed under the same prefix. Gems an OS package installed are
260
+ * left to that package, as is any gem whose install has no unpackaged runtime.
261
+ *
262
+ * @param {Object[]} components BOM components
263
+ * @param {string} [rootDir] extracted root the source paths may start with
264
+ * @returns {{ref: string, dependsOn: string[]}[]} edges from each runtime to
265
+ * its default gems
266
+ */
267
+ export declare function linkDefaultGemsToRuntimes(components: Object[], rootDir?: string): {
268
+ ref: string;
269
+ dependsOn: string[];
270
+ }[];
271
+ //# sourceMappingURL=rubyBuildInfo.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rubyBuildInfo.d.ts","sourceRoot":"","sources":["../../../lib/inventory/rubyBuildInfo.js"],"names":[],"mappings":"AAkCA;;;;GAIG;AACH,eAAO,MAAM,eAAe,EAFlB,MAEuB,CAAC;AA0BlC;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAH1B,MAG0B,GAFxB,MAAM,GAAC,SAAS,CAc5B;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAN9B,MAM8B,GAL5B;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC9D,WAAW,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAC,GAAC,SAAS,CA2DtD;AAED;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAJvB,MAIuB,GAHrB;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAC;IAC5D,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAC,GAAC,SAAS,CAwC/C;AAED;;;;;;;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M,GAAC,SAAS,CAwB5B;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,4BAA4B,CAAC,UAAU,EAH5C,MAAM,EAGsC,GAF1C,MAAM,EAAE,CAgEpB;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,WAAW,EAJlC,MAIkC,GAHhC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAC,GAAC,SAAS,CAqBnD;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EALlC,MAKkC,EAAE,MAAM,UAAA,EAAE,QAAQ,AAH5D,CACA,EADQ,MAGoD,GAFlD,OAAO,CA6BnB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,yBAAyB,CAAC,UAAU,EALzC,MAAM,EAKmC,EAAE,OAAO,AAJ1D,CACA,EADQ,MAIkD,GAHhD;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,EAAE,CAAA;CAAC,EAAE,CAkEhD"}
@@ -0,0 +1,47 @@
1
+ export declare const RUBY_VERSION_MANAGER_DIRECTORIES: string[];
2
+ export declare const HOME_PARENTS: {
3
+ linux: string[];
4
+ darwin: string[];
5
+ };
6
+ /**
7
+ * Expand a relative directory pattern whose `*` segments match one directory
8
+ * name each.
9
+ *
10
+ * @param {string} base absolute directory the pattern hangs off
11
+ * @param {string} pattern `/`-separated relative pattern
12
+ * @returns {string[]} existing directories, at most MAX_EXPANDED_DIRECTORIES
13
+ */
14
+ export declare function expandDirectories(base: string, pattern: string): string[];
15
+ /**
16
+ * The home directories of a host: /root and /home/* on Linux, /Users/* on
17
+ * macOS.
18
+ *
19
+ * @param {{rootPath: string, platform: string}} context probe context
20
+ * @returns {string[]}
21
+ */
22
+ export declare function homeDirectories(context: {
23
+ rootPath: string;
24
+ platform: string;
25
+ }): string[];
26
+ /**
27
+ * The directories a Windows Ruby lives in: the RubyInstaller's C:\Ruby34-x64,
28
+ * Chocolatey's C:\tools\ruby34, and the hosted toolcache.
29
+ *
30
+ * @param {Object} context probe context
31
+ * @returns {string[]} install roots, each with a `bin` directory
32
+ */
33
+ export declare function windowsRubyRoots(context: Object): string[];
34
+ /**
35
+ * Look for Ruby no package manager owns on the host. Components come back
36
+ * only for the files nothing owns: a `file` component for each `ruby` binary
37
+ * with the cdx:ruby properties, and one `platform` component per Ruby version
38
+ * with its CPE.
39
+ *
40
+ * @param {Object} [options] probe options, as probeHostPhp takes them
41
+ * @returns {{components: Object[], dependencies: Object[]}}
42
+ */
43
+ export declare function probeHostRuby(options?: Object): {
44
+ components: Object[];
45
+ dependencies: Object[];
46
+ };
47
+ //# sourceMappingURL=rubyHostProbe.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rubyHostProbe.d.ts","sourceRoot":"","sources":["../../../lib/inventory/rubyHostProbe.js"],"names":[],"mappings":"AAwDA,eAAO,MAAM,gCAAgC,UAQ5C,CAAC;AAEF,eAAO,MAAM,YAAY;IACvB,KAAK;IACL,MAAM;CACP,CAAC;AAEF;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAJ3B,MAI2B,EAAE,OAAO,EAHpC,MAGoC,GAFlC,MAAM,EAAE,CAwBpB;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAH5B;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAGP,GAF1B,MAAM,EAAE,CAiBpB;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAH7B,MAG6B,GAF3B,MAAM,EAAE,CAiBpB;AA0BD;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAAC,OAAO,AAHlC,CACA,EADQ,MAG+B,GAF7B;IAAC,UAAU,EAAE,MAAM,EAAE,CAAC;IAAC,YAAY,EAAE,MAAM,EAAE,CAAA;CAAC,CAmC1D"}
@@ -15,10 +15,14 @@ export declare function isSafeGitRefName(refName: string | undefined): boolean;
15
15
  * @param {string[]} args git arguments
16
16
  * @param {Object} options command options
17
17
  * @param {string|undefined} options.cwd working directory
18
+ * @param {boolean|undefined} options.noRepository run outside any repository,
19
+ * so the config of a repository in the working directory, such as url.*.insteadOf
20
+ * or core.sshCommand, cannot change where a remote command connects
18
21
  * @returns {Object} spawn result
19
22
  */
20
23
  export declare function hardenedGitCommand(args: string[], options?: {
21
24
  cwd: string | undefined;
25
+ noRepository: boolean | undefined;
22
26
  }): Object;
23
27
  /**
24
28
  * Build CycloneDX release notes from git tags and commits.
@@ -55,6 +59,17 @@ export declare function isAllowedWinPath(p: string): boolean;
55
59
  * @returns {boolean} true if the path is present in the allowed paths. false otherwise.
56
60
  */
57
61
  export declare function isAllowedPath(p: string): boolean;
62
+ /**
63
+ * Checks where the given path really points, after following symlinks, against
64
+ * where the allowed paths really point. Both sides are resolved, so an allowed
65
+ * directory that is itself reached through a link (such as /tmp on macOS) still
66
+ * matches, while a link inside an allowed directory that leads outside it does
67
+ * not.
68
+ *
69
+ * @param {string} p Path string to check
70
+ * @returns {boolean} true if the real path is inside a real allowed path
71
+ */
72
+ export declare function isAllowedRealPath(p: string): boolean;
58
73
  /**
59
74
  * Determine if the path could be a package URL.
60
75
  *
@@ -76,6 +91,29 @@ export declare function maybeRemotePath(filePath: string): boolean;
76
91
  * @returns {Object|null} Error object if invalid, or null if valid
77
92
  */
78
93
  export declare function validateAndRejectGitSource(filePath: string): Object | null;
94
+ /**
95
+ * Return the host a git client connects to for a remote, read the way git,
96
+ * libcurl and OpenSSH read it rather than the way new URL() does. git ends the
97
+ * authority of ssh:// and git:// URLs only at the first slash, percent-decodes
98
+ * it before splitting off the host, and reads a leading "[...]" as the host.
99
+ * OpenSSH takes the host after the last "@". So a "?" or "#" before the first
100
+ * slash, a second "@", brackets in the user name, or a percent sign in an
101
+ * ssh:// or git:// authority make the host ambiguous.
102
+ *
103
+ * @param {string} remote Git URL or SCP-like address
104
+ * @returns {string|undefined} lower-cased host, or undefined when it is ambiguous
105
+ */
106
+ export declare function getGitRemoteHost(remote: string): string | undefined;
107
+ /**
108
+ * Remove credentials from git output before it is logged. Every URL in the
109
+ * text loses its user name and password, which git copies into its error
110
+ * messages from the remote it was given.
111
+ *
112
+ * @param {string|undefined} text Output of a git command
113
+ * @param {string|undefined} repoUrl Remote the command was given
114
+ * @returns {string|undefined} Output with credentials replaced by ***
115
+ */
116
+ export declare function redactGitOutput(text: string | undefined, repoUrl: string | undefined): string | undefined;
79
117
  /**
80
118
  * Clone a git repository into a temporary directory.
81
119
  *
@@ -1 +1 @@
1
- {"version":3,"file":"source.d.ts","sourceRoot":"","sources":["../../../lib/inventory/source.js"],"names":[],"mappings":"AAqCA,6FAA6F;AAC7F,eAAO,MAAM,4BAA4B,wIAC8F,CAAC;AAExI,6DAA6D;AAC7D,eAAO,MAAM,2BAA2B,UAWvC,CAAC;AAuBF;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAH7B,MAAM,GAAC,SAGsB,GAF3B,OAAO,CAUnB;AAiBD;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAL5B,MAAM,EAKsB,EAAE,OAAO,GAH7C;IAAkC,GAAG,EAA7B,MAAM,GAAC,SAAS,CACxB;CAEkD,GAFxC,MAAM,CAuClB;AA+ED;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CAAC,QAAQ,EAJtC,MAAM,GAAC,SAI+B,EAAE,OAAO,GAH/C,MAGoD,GAFlD,MAAM,GAAC,SAAS,CA6I5B;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,IAFtB,MAAM,CASlB;AAkBD;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,QAAQ,EAH3B,MAG2B,GAFzB,OAAO,CAWnB;AAkBD;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,EAHvB,MAGuB,GAFrB,OAAO,CA+BnB;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,CAAC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kJD;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,UAAU,EAHlC,MAGkC,GAFhC;IAAC,MAAM,EAAC,MAAM,CAAC;IAAA,KAAK,EAAC,MAAM,CAAC;IAAA,OAAO,EAAC,MAAM,CAAA;CAAC,GAAC,IAAI,CA4D5D;AA6GD;;GAEG;AACH,wBAAgB,yBAAyB,SAExC;AAID;;;;;;;;;;;GAWG;AACH,wBAAsB,qBAAqB,CAAC,WAAW,EAJ5C,KAAK,CAAC,MAAM,CAIgC,GAF1C,OAAO,CAAC,IAAI,CAAC,CA6BzB;AAiDD;;;;;;;;;;GAUG;AACH,wBAAsB,qBAAqB,CAAC,UAAU,EAJ3C,MAI2C,EAAE,OAAO,AAH5D,CACA,EADQ,MAGyD,GAFvD,OAAO,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAC,GAAC,SAAS,CAAC,CA6MlI;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAF5B,MAE4B,QAkCtC"}
@@ -66,6 +66,21 @@ export declare function findLicenseId(name: string): any;
66
66
  * @returns {string|undefined} SPDX license id or expression
67
67
  */
68
68
  export declare function licenseIdFromText(content: string): string | undefined;
69
+ /**
70
+ * Identify every license a notice grants, in the order the notice grants
71
+ * them. A notice can grant several: one LICENSE file holding an MIT grant and
72
+ * an Apache-2.0 grant (gopkg.in/yaml.v3), or a choice of licenses followed by
73
+ * each full text (github.com/spdx/tools-golang). A license text quotes others
74
+ * (the GNU GPL names the GNU Lesser GPL, the MPL names the GNU licenses), so
75
+ * only phrases that a grant carries count: a GNU license is found by its title
76
+ * standing on a line of its own, the others by a sentence of their grant.
77
+ * A notice none of these phrases match falls back to {@link guessLicenseId}.
78
+ *
79
+ * @param {string} content License file contents
80
+ * @returns {string[]} SPDX license ids or expressions; empty when none is
81
+ * recognized
82
+ */
83
+ export declare function guessLicenseIds(content: string): string[];
69
84
  /**
70
85
  * Method to guess the spdx license id from license contents
71
86
  *
@@ -1 +1 @@
1
- {"version":3,"file":"spdx.d.ts","sourceRoot":"","sources":["../../../lib/inventory/spdx.js"],"names":[],"mappings":"AAeA;;;;GAIG;AACH,eAAO,MAAM,YAAY,EAFf,MAAM,EAIf,CAAC;AAMF;;;;;;IAMI;AACJ,wBAAgB,uBAAuB,CAAC,OAAO,EAJpC,MAIoC,GAHlC,OAAO,CA0BnB;AAED;;;;;;;;;GASG;AACH,wBAAgB,wBAAwB,CAAC,QAAQ,OAAA,SA2BhD;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,GAAG,KAAA,qBAqG9B;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,UAAU,QAAA,EAAE,GAAG,QAAA,GAFnC,MAAM,CAoDjB;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,GAAG,KAAA,EAAE,CAAC,KAAA,EAAE,cAAc,KAAA,QAoCpD;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,eAAe,KAAA,EAAE,kBAAkB,KAAA;;SAUlE;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAFvB,MAEuB,OAYjC;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAH9B,MAG8B,GAF5B,MAAM,GAAC,SAAS,CAyF5B;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAF3B,MAE2B,OAcrC"}
1
+ {"version":3,"file":"spdx.d.ts","sourceRoot":"","sources":["../../../lib/inventory/spdx.js"],"names":[],"mappings":"AAeA;;;;GAIG;AACH,eAAO,MAAM,YAAY,EAFf,MAAM,EAIf,CAAC;AAMF;;;;;;IAMI;AACJ,wBAAgB,uBAAuB,CAAC,OAAO,EAJpC,MAIoC,GAHlC,OAAO,CA0BnB;AAED;;;;;;;;;GASG;AACH,wBAAgB,wBAAwB,CAAC,QAAQ,OAAA,SA2BhD;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,GAAG,KAAA,qBAqG9B;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,UAAU,QAAA,EAAE,GAAG,QAAA,GAFnC,MAAM,CAoDjB;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,GAAG,KAAA,EAAE,CAAC,KAAA,EAAE,cAAc,KAAA,QAoCpD;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,eAAe,KAAA,EAAE,kBAAkB,KAAA;;SAUlE;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAFvB,MAEuB,OAYjC;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAH9B,MAG8B,GAF5B,MAAM,GAAC,SAAS,CAyF5B;AAqDD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAJ5B,MAI4B,GAH1B,MAAM,EAAE,CAgFpB;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAF3B,MAE2B,OAcrC"}
@@ -57,7 +57,7 @@ export declare function resolveSaferExecBinary(): string | undefined;
57
57
  * @param {boolean} [options.denyPersistenceWrites] - Deny writes to auto-execution and persistence locations
58
58
  * @param {boolean} [options.privateTmp] - Private tmpfs /tmp and /var/tmp (Linux)
59
59
  * @param {string} [options.protectHome] - Home isolation: read-only, tmpfs, or off (Linux)
60
- * @returns {Promise<{libPaths: string[], httpAccessEntries: Object[], egressEntries?: Object[], dryRunSummary?: Object}>} Collected libraries, HTTP URLs, proxy egress decisions, and the dry-run summary
60
+ * @returns {Promise<{libPaths: string[], httpAccessEntries: Object[], cryptoEntries?: Object[], cryptoComponents?: Object[], cryptoResult?: Object, egressEntries?: Object[], dryRunSummary?: Object}>} Collected libraries, HTTP URLs, crypto observations, proxy egress decisions, and the dry-run summary
61
61
  * @throws {Error} When the @cdxgen/safer-exec tracing runtime is not installed
62
62
  * (for example after pruning it from a standalone payload), since the traced
63
63
  * command could never run and the BOM would silently be empty
@@ -94,6 +94,9 @@ export declare function executeAndTrace(commandStr: string, workingDir?: string,
94
94
  }): Promise<{
95
95
  libPaths: string[];
96
96
  httpAccessEntries: Object[];
97
+ cryptoEntries?: Object[];
98
+ cryptoComponents?: Object[];
99
+ cryptoResult?: Object;
97
100
  egressEntries?: Object[];
98
101
  dryRunSummary?: Object;
99
102
  }>;
@@ -1 +1 @@
1
- {"version":3,"file":"traceRunner.d.ts","sourceRoot":"","sources":["../../../lib/inventory/traceRunner.js"],"names":[],"mappings":"AAsBA;;;;;;GAMG;AACH,wBAAgB,oBAAoB,IAFvB,OAAO,CAInB;AAKD;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAHxB,MAGwB,GAFtB;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,EAAE,CAAA;CAAC,CA6BzC;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,IAFzB,MAAM,GAAC,SAAS,CAsF5B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,wBAAsB,eAAe,CAAC,UAAU,EApCrC,MAoCqC,EAAE,UAAU,AAnCzD,CACA,EADQ,MAmCiD,EAAE,OAAO,AAlClE,CA6BA,EA5BA;IAA2B,SAAS,AAApC,CACA,EADQ,MAAM,EAAE,CAChB;IAA2B,UAAU,AAArC,CACA,EADQ,MAAM,EAAE,CAChB;IAAyB,WAAW,AAApC,CACA,EADQ,MAAM,CACd;IAAyB,WAAW,AAApC,CACA,EADQ,MAAM,CACd;IAAyB,YAAY,AAArC,CACA,EADQ,MAAM,CACd;IAAyB,SAAS,AAAlC,CACA,EADQ,MAAM,CACd;IAA0B,cAAc,AAAxC,CACA,EADQ,OAAO,CACf;IAA0B,aAAa,AAAvC,CACA,EADQ,OAAO,C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AACH,wBAAgB,cAAc,CAAC,MAAM,EAH1B,MAG0B,GAFxB;IAAC,QAAQ,EAAE,MAAM,EAAE,CAAC;IAAC,KAAK,EAAE,MAAM,GAAC,SAAS,CAAA;CAAC,CAazD;AAuBD;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAHhC,MAAM,EAG0B,GAF9B;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAC,EAAE,CAkD9E;AAED;;;;;;GAMG;AACH,wBAAgB,0BAA0B,CAAC,iBAAiB,EAHjD,MAAM,EAG2C;eAFlB,GAAG,CAAC,MAAM,CAAC;gBAAc,MAAM,EAAE;GA+C1E"}
@@ -28,6 +28,28 @@ export declare function suiteCipher(suiteName: string): {
28
28
  * @returns {Object[]} Normalized cryptographic-asset components
29
29
  */
30
30
  export declare function normalizeTracedCryptoComponents(cbomComponents: Object[]): Object[];
31
+ /**
32
+ * Builds the shared certificate model for the chains servers presented in TLS
33
+ * ≤ 1.2 handshakes, from the `chain` arrays of safer-exec's crypto result
34
+ * (report channel, safer-exec ≥ 1.2.0; earlier releases and TLS 1.3 entries
35
+ * carry no chain and yield nothing). The records go through the shared
36
+ * certificate collector, so bom-refs, properties and dedup match certificates
37
+ * found on disk. A presented chain is untrusted server input: no issuer edges
38
+ * are inferred from it, and the certificate and public-key components link
39
+ * through the collector as every producer's do. Each TLS protocol component
40
+ * provides the certificates and keys presented under it — the edge safer-
41
+ * exec's own CBOM records — which answers which servers presented a key.
42
+ *
43
+ * @param {Object} cryptoResult safer-exec CRYPTO result (`result.crypto`)
44
+ * @param {Set<string>} protocolRefs bom-refs of the protocol components in the BOM;
45
+ * a provides edge is only emitted for a protocol that is actually present
46
+ * @returns {{components: Object[], dependencies: Object[]}} certificate,
47
+ * public-key and algorithm components, and the protocol provides edges
48
+ */
49
+ export declare function observedChainComponents(cryptoResult: Object, protocolRefs?: Set<string>): {
50
+ components: Object[];
51
+ dependencies: Object[];
52
+ };
31
53
  /**
32
54
  * Maps the crypto libraries safer-exec reported to the paths they were loaded
33
55
  * from.
@@ -1 +1 @@
1
- {"version":3,"file":"tracedCrypto.d.ts","sourceRoot":"","sources":["../../../lib/inventory/tracedCrypto.js"],"names":[],"mappings":"AAqDA;;;;;;;GAOG;AACH,wBAAgB,WAAW,CAAC,SAAS,EAH1B,MAG0B,GAFxB;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,GAAC,SAAS,CAAA;CAAC,GAAC,SAAS,CAuB1E;AA+DD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,+BAA+B,CAAC,cAAc,EAHnD,MAAM,EAG6C,GAFjD,MAAM,EAAE,CA+GpB;AAED;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CAAC,aAAa,EAHxC,MAAM,EAGkC,GAFtC,GAAG,CAAC,MAAM,EAAE;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAC,CAAC,CAgBxD"}
1
+ {"version":3,"file":"tracedCrypto.d.ts","sourceRoot":"","sources":["../../../lib/inventory/tracedCrypto.js"],"names":[],"mappings":"AA0DA;;;;;;;GAOG;AACH,wBAAgB,WAAW,CAAC,SAAS,EAH1B,MAG0B,GAFxB;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,GAAC,SAAS,CAAA;CAAC,GAAC,SAAS,CAuB1E;AA+DD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,+BAA+B,CAAC,cAAc,EAHnD,MAAM,EAG6C,GAFjD,MAAM,EAAE,CA+GpB;AAqBD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,uBAAuB,CACrC,YAAY,EAPH,MAOG,EACZ,YAAY,GAPH,GAAG,CAAC,MAAM,CAOK,GALb;IAAC,UAAU,EAAE,MAAM,EAAE,CAAC;IAAC,YAAY,EAAE,MAAM,EAAE,CAAA;CAAC,CAwF1D;AAED;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CAAC,aAAa,EAHxC,MAAM,EAGkC,GAFtC,GAAG,CAAC,MAAM,EAAE;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAC,CAAC,CAgBxD"}
@@ -115,6 +115,16 @@ export declare function dropRedundantSourceComponents(pkgList: any[]): any[];
115
115
  * @returns {Object} Metadata containing packages, dependencies, etc
116
116
  */
117
117
  export declare function getOSPackages(src: string, imageConfig: Object, options?: {}): Object;
118
+ /**
119
+ * Split a `Name <address>` maintainer string into an `organizationalContact`.
120
+ *
121
+ * @param {string} value Maintainer or supplier string
122
+ * @returns {{name: string, email?: string}|undefined} The contact, if any
123
+ */
124
+ export declare function parseOrganizationalContact(value: string): {
125
+ name: string;
126
+ email?: string;
127
+ } | undefined;
118
128
  /**
119
129
  * Collect the dependency edges trivy recorded for one OS package component.
120
130
  *
@@ -1 +1 @@
1
- {"version":3,"file":"binary.d.ts","sourceRoot":"","sources":["../../../lib/managers/binary.js"],"names":[],"mappings":"AA+YA;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CAAC,SAAS,AAH9C,CACA,EADQ,MAAM,EAGqC,GAFzC,MAAM,EAAE,CAgBpB;AA4FD;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,EAJ9B,MAI8B,GAH5B,MAAM,GAAC,SAAS,CAmB5B;AAED;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EALtB,MAKsB,UA+BpC;AAED;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,OAAA,EAAE,GAAG,EAJ9B,MAI8B,GAFhC,SAAS,GAAC,MAAM,CAmC5B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,w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oB,0DAJtB,MAAM,QACN,MAAM,KACJ;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,EAAE,CAAA;CAAC,GAAC,SAsD/C,CAAC;AAyHF;;;;;;;;GAQG;AACH,wBAAgB,+BAA+B,CAAC,UAAU,AALvD,CACA,EADQ,MAAM,EAK8C,GAJlD;IAAC,UAAU,EAAE,MAAM,EAAE,CAAC;IAAC,KAAK,EAAE,MAAM,EAAE,CAAA;CAAC,CA8FnD;AAED;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,KAAK,EALzB,MAKyB,GAJvB,MAAM,GAAC,SAAS,CA8D5B;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAJxB,MAIwB,EAAE,UAAU,EAHpC,MAGoC,WA6C9C;AAED;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAAC,GAAG,EANrB,MAMqB,EAAE,aAAa,EALpC,MAKoC,EAAE,QAAQ,EAJ9C,OAI8C,GAF7C,OAAO,CAiClB"}
@@ -74,6 +74,18 @@ export declare const makeRequest: (path: string, method: string, forRegistry?: s
74
74
  * @returns {boolean} true when the string is a plausible image reference
75
75
  */
76
76
  export declare const isImageReference: (fullImageName: string) => boolean;
77
+ /**
78
+ * Whether an image named in a scanned manifest, such as a docker-compose file
79
+ * or a Kubernetes spec, may be pulled and inventoried. The name comes from the
80
+ * scanned project, so a local archive path would read files outside the
81
+ * allowed paths and a registry outside CDXGEN_ALLOWED_HOSTS would bypass the
82
+ * host allowlist.
83
+ *
84
+ * @param {string} fullImageName Image name from the manifest
85
+ * @param {Object} [imageObj] Result of parseImageName for the same name
86
+ * @returns {boolean} true when the image may be followed
87
+ */
88
+ export declare const isFollowableManifestImage: (fullImageName: string, imageObj?: Object) => boolean;
77
89
  /**
78
90
  * Parse image name
79
91
  *
@@ -145,6 +157,18 @@ export declare const extractFromManifest: (manifestFile: string, localData: Obje
145
157
  * Returns the location of the layers with additional packages related metadata
146
158
  */
147
159
  export declare const exportImage: (fullImageName: any, options: any) => Promise<any>;
160
+ /**
161
+ * The gem directories an image's environment names in GEM_HOME, GEM_PATH and
162
+ * BUNDLE_PATH. Only absolute paths without `..` segments are kept, so an image
163
+ * cannot steer the scan outside its own root, and each is normalized; the root
164
+ * and broad system directories such as /usr or /var are refused, so an image
165
+ * cannot turn the gem scan into a scan of the whole tree.
166
+ *
167
+ * @param {string[]|undefined} env image config Env entries, `NAME=value`
168
+ * @returns {string[]} absolute in-image directories, deduplicated, at most
169
+ * MAX_IMAGE_GEM_DIRS
170
+ */
171
+ export declare function imageGemDirs(env: string[] | undefined): string[];
148
172
  /**
149
173
  * Method to retrieve path list for system-level packages
150
174
  */
@@ -1 +1 @@
1
- {"version":3,"file":"docker.d.ts","sourceRoot":"","sources":["../../../lib/managers/docker.js"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AA+CrC,yDAAyD;AACzD,eAAO,MAAM,KAAK,SAA0B,CAAC;AAC7C;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,EAFtB,MAEoC,CAAC;AAkS/C;;;;;;;GAOG;AACH,eAAO,MAAM,iBAAiB,SAHnB,MAAM,KACJ,MAiBZ,CAAC;AAEF;;GAEG;AACH,wBAAgB,YAAY,QAoB3B;AAED;;GAEG;AACH,wBAAgB,oBAAoB,QA2CnC;AAyTD;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,aAAa,aANf,MAAM,gBAEN,MAAM,KACJ,OAAO,CAAC,MAAM,GAAC,SAAS,CA6HpC,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,WAAW,SANb,MAAM,UACN,MAAM,gBACN,MAAM,KACJ,OAAO,CAAC,MAAM,GAAC,MAAM,GAAC,SAAS,CAgC3C,CAAC;AA8CF;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,gBAAgB,kBAHlB,MAAM,KACJ,OAsEZ,CAAC;AAgBF;;;;;;;G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AAM,wBACN,MAAM,WACN,MAAM,KACJ,OAAO,CAAC,MAAM,CAwK1B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,WAAW,oDAyJvB,CAAC;AAgCF;;;;;;;;;;GAUG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAJrB,MAAM,EAAE,GAAC,SAIY,GAHnB,MAAM,EAAE,CA+BpB;AAED;;GAEG;AACH,eAAO,MAAM,cAAc,iDAyJ1B,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,WAAW,kBALb,MAAM,UACN,OAAO,KACL,OAAO,CAAC,MAAM,GAAC,SAAS,CAKpC,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,kBAAkB,cALpB,MAAM,iBACN,MAAM,KACJ,MAAM,GAAC,SA2CnB,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,kBAAkB,qBAHpB,KAAK,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAC,CAAC,cACnC,KAAK,CAAC,MAAM,CAAC,SA4BvB,CAAC"}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * An internationalized hostname: mapped to its A-label form with UTS #46
3
+ * processing, held to the ASCII hostname rules, and every A-label decoded
4
+ * back and checked for the characters IDNA allows.
5
+ *
6
+ * @param {string} hostname Hostname, possibly holding non-ASCII labels
7
+ * @returns {boolean} Whether it is a valid IDN hostname
8
+ */
9
+ export declare const isValidIdnHostname: (hostname: string) => boolean;
10
+ /**
11
+ * Whether a value is a valid RFC 6531 email address (`idn-email`): a dot-atom
12
+ * or quoted local part, where non-ASCII characters are allowed, then `@` and
13
+ * an internationalized hostname or a bracketed IPv4/IPv6 literal.
14
+ *
15
+ * @param {string} value Candidate email address
16
+ * @returns {boolean} true when the value is a valid address
17
+ */
18
+ export declare const isValidIdnEmail: (value: string) => boolean;
19
+ //# sourceMappingURL=email.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"email.d.ts","sourceRoot":"","sources":["../../../lib/parsers/email.js"],"names":[],"mappings":"AA8LA;;;;;;;GAOG;AACH,eAAO,MAAM,kBAAkB,aAHpB,MAAM,KACJ,OAyCZ,CAAC;AAkBF;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe,UAHjB,MAAM,KACJ,OAeZ,CAAC"}
@@ -17,14 +17,28 @@ export declare function indexJsonObject(filePath: string, options?: Object): Map
17
17
  start: number;
18
18
  end: number;
19
19
  }>;
20
+ /**
21
+ * Decode one member of the top-level object in a JSON file, reading the file
22
+ * only up to the end of that member. A member near the start of a large file
23
+ * costs a few bounded reads, however large the rest of the file is; the rest
24
+ * is not checked for well-formedness.
25
+ *
26
+ * @param {string} filePath JSON file whose top-level value is an object
27
+ * @param {string} name Member to decode
28
+ * @param {Object} [options] Batch and chunk size overrides, for tests
29
+ * @returns {*} The decoded value, or undefined when the object has no such member
30
+ * @throws {SyntaxError} When the object is malformed before the member ends
31
+ */
32
+ export declare function readJsonMember(filePath: string, name: string, options?: Object): any;
20
33
  /**
21
34
  * Decode the JSON value stored in a byte range of a file, without ever holding
22
35
  * more than a bounded run of it in one string.
23
36
  *
24
37
  * `spec` narrows what is kept. `{ members: { name: spec } }` keeps only the
25
- * named members of an object, each narrowed by its own spec. `{ filter }`
26
- * keeps the elements of an array that `filter(element)` accepts. Anything else
27
- * keeps the whole value.
38
+ * named members of an object, each narrowed by its own spec. `{ map }`
39
+ * transforms each element of an array, an undefined result dropping it, and
40
+ * `{ filter }` keeps the mapped elements that `filter(element)` accepts.
41
+ * Anything else keeps the whole value.
28
42
  *
29
43
  * @param {string} filePath JSON file
30
44
  * @param {{start: number, end: number}} range Byte range of the value, such as one returned by indexJsonObject