@cdxgen/cdxgen 13.3.0 → 13.5.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.
- package/README.md +12 -9
- package/bin/cdxgen-secure.js +15 -0
- package/bin/cdxgen.js +115 -31
- package/bin/evinse.js +23 -1
- package/bin/hbom.js +15 -7
- package/bin/repl.js +115 -0
- package/bin/sign.js +45 -15
- package/bin/tracebom.js +5 -1
- package/bin/validate.js +84 -18
- package/bin/verify.js +155 -86
- package/data/cbomosdb-queries.json +13 -1
- package/data/component-tags.json +8 -0
- package/data/helpers/init.gradle +46 -21
- package/data/queries-darwin.json +25 -1
- package/data/queries-win.json +19 -1
- package/data/queries.json +41 -0
- package/data/remediations.json +344 -1
- package/data/rules/cbom-security.yaml +235 -4
- package/data/rules/dependency-sources.yaml +67 -0
- package/data/rules/go-binaries.yaml +46 -0
- package/data/rules/golem-go.yaml +80 -0
- package/data/rules/hbom-compliance.yaml +40 -22
- package/data/rules/hbom-performance.yaml +7 -1
- package/data/rules/host-topology.yaml +1 -1
- package/data/rules/obom-runtime.yaml +31 -2
- package/data/rules/php-runtime.yaml +143 -0
- package/data/rules/scala-evidence.yaml +115 -0
- package/lib/audit/index.js +52 -6
- package/lib/cli/bomAssembly.js +28 -3
- package/lib/cli/cliOptions.js +110 -3
- package/lib/cli/index.js +186 -58
- package/lib/cli/jsBom.js +50 -29
- package/lib/cli/jvmBom.js +779 -146
- package/lib/cli/managedBom.js +1021 -261
- package/lib/cli/nativeBom.js +364 -58
- package/lib/core/activity.js +12 -0
- package/lib/core/env.js +47 -17
- package/lib/core/fs.js +31 -21
- package/lib/core/httpClient.js +233 -69
- package/lib/core/pluginRun.js +184 -0
- package/lib/core/processTree.js +100 -0
- package/lib/core/projectConfig.js +1 -0
- package/lib/core/projectTooling.js +97 -0
- package/lib/core/propertySanitizer.js +72 -0
- package/lib/core/runState.js +39 -0
- package/lib/core/toml.js +72 -0
- package/lib/ecosystems/asarutils.js +4 -2
- package/lib/ecosystems/bunutils.js +5 -7
- package/lib/ecosystems/cargoCache.js +231 -8
- package/lib/ecosystems/cmakeResolver.js +10 -21
- package/lib/ecosystems/cppBuildContext.js +631 -0
- package/lib/ecosystems/cppEvidence.js +337 -22
- package/lib/ecosystems/cppIncludeResolver.js +294 -0
- package/lib/ecosystems/denoutils.js +93 -66
- package/lib/ecosystems/ecosystems.js +1967 -788
- package/lib/ecosystems/golem.js +578 -18
- package/lib/ecosystems/gradleutils.js +340 -46
- package/lib/ecosystems/jsEvidence.js +85 -24
- package/lib/ecosystems/kosi.js +21 -4
- package/lib/ecosystems/npmutils.js +64 -0
- package/lib/ecosystems/parsers-dotnet.js +668 -153
- package/lib/ecosystems/parsers-elm.js +46 -28
- package/lib/ecosystems/parsers-gleam.js +3 -4
- package/lib/ecosystems/parsers-go.js +1283 -297
- package/lib/ecosystems/parsers-js.js +92 -26
- package/lib/ecosystems/parsers-julia.js +2 -3
- package/lib/ecosystems/parsers-jvm.js +463 -29
- package/lib/ecosystems/parsers-misc.js +405 -93
- package/lib/ecosystems/parsers-python.js +152 -20
- package/lib/ecosystems/parsers-rust.js +4 -4
- package/lib/ecosystems/parsers-terraform.js +1573 -19
- package/lib/ecosystems/pythonutils.js +102 -6
- package/lib/ecosystems/remote/huggingface.js +3 -0
- package/lib/ecosystems/rubyutils.js +73 -20
- package/lib/ecosystems/rusi.js +32 -9
- package/lib/ecosystems/sbtutils.js +243 -187
- package/lib/ecosystems/scalacliutils.js +343 -0
- package/lib/ecosystems/scalasem.js +2620 -0
- package/lib/ecosystems/terraformRegistry.js +288 -0
- package/lib/ecosystems/utils.js +2 -0
- package/lib/ecosystems/vendoredCode.js +156 -0
- package/lib/evinser/evinser.js +695 -78
- package/lib/evinser/swiftsem.js +68 -5
- package/lib/helpers/agenticToolutils.js +2 -2
- package/lib/helpers/bomSigner.js +576 -128
- package/lib/inventory/agentSkillSpec.js +17 -0
- package/lib/inventory/aiCollector.js +4 -1
- package/lib/inventory/analyzer.js +110 -127
- package/lib/inventory/apkInstalledDb.js +243 -0
- package/lib/inventory/atomUtils.js +204 -48
- package/lib/inventory/auditCategories.js +10 -3
- package/lib/inventory/buildToolRateLimit.js +144 -0
- package/lib/inventory/cacheCommands.js +2 -1
- package/lib/inventory/cacheDir.js +52 -9
- package/lib/inventory/certificates.js +2371 -0
- package/lib/inventory/cmakeBuildDirs.js +254 -0
- package/lib/inventory/communityAiConfigParser.js +4 -9
- package/lib/inventory/deps.js +507 -128
- package/lib/inventory/display.js +200 -3
- package/lib/inventory/dosai.js +747 -101
- package/lib/inventory/dosaiParsers.js +310 -15
- package/lib/inventory/dynamic.js +96 -8
- package/lib/inventory/envcontext.js +168 -5
- package/lib/inventory/evidenceUtils.js +590 -132
- package/lib/inventory/fetchBatch.js +574 -38
- package/lib/inventory/fetchDiskCache.js +597 -0
- package/lib/inventory/forgeEnricher.js +14 -5
- package/lib/inventory/formulationParsers.js +3 -2
- package/lib/inventory/goBuildInfo.js +140 -0
- package/lib/inventory/hbom.js +67 -7
- package/lib/inventory/hbomAnalysis.js +16 -0
- package/lib/inventory/hostTopology.js +21 -0
- package/lib/inventory/jvmLocalRepos.js +917 -0
- package/lib/inventory/mcpConfigParser.js +2 -3
- package/lib/inventory/osPackagePurl.js +244 -0
- package/lib/inventory/osPackageResolver.js +89 -87
- package/lib/inventory/osinfo.js +79 -31
- package/lib/inventory/osqueryTransform.js +114 -5
- package/lib/inventory/parentSelection.js +146 -0
- package/lib/inventory/phpBuildInfo.js +487 -0
- package/lib/inventory/phpHostProbe.js +641 -0
- package/lib/inventory/rootfsCerts.js +426 -0
- package/lib/inventory/rustFormulationParser.js +3 -4
- package/lib/inventory/scalaCoords.js +153 -0
- package/lib/inventory/source.js +215 -11
- package/lib/inventory/spdx.js +245 -0
- package/lib/inventory/traceRunner.js +93 -8
- package/lib/inventory/tracedCrypto.js +423 -0
- package/lib/managers/binary.js +529 -183
- package/lib/managers/docker.js +199 -44
- package/lib/managers/oci.js +24 -2
- package/lib/parsers/cmakeCache.js +69 -0
- package/lib/parsers/cmakeLists.js +16 -2
- package/lib/parsers/cmakePresets.js +400 -0
- package/lib/parsers/compileCommands.js +557 -0
- package/lib/parsers/email.js +277 -0
- package/lib/parsers/largeJson.js +34 -2
- package/lib/parsers/strictJson.js +322 -0
- package/lib/parsers/terraformConfig.js +1073 -0
- package/lib/parsers/terraformSource.js +652 -0
- package/lib/server/server.js +209 -1
- package/lib/stages/postgen/annotator.js +17 -1
- package/lib/stages/postgen/introspection/markers.js +1 -1
- package/lib/stages/postgen/introspection/reflect.js +4 -1
- package/lib/stages/postgen/postgen.js +20 -6
- package/lib/stages/postgen/ruleEngine.js +58 -1
- package/lib/stages/postgen/specVersionCompat.js +62 -0
- package/lib/stages/pregen/pregen.js +117 -5
- package/lib/validator/bomValidator.js +26 -5
- package/lib/validator/generated/runtime.mjs +13 -0
- package/lib/validator/generated/validate-1.6.mjs +26 -7
- package/lib/validator/generated/validate-1.7.mjs +31 -12
- package/lib/validator/generated/validate-2.0.mjs +30 -11
- package/lib/validator/index.js +25 -10
- package/lib/validator/reporters/json.js +1 -0
- package/package.json +23 -23
- package/types/bin/cdxgen-secure.d.ts +3 -0
- package/types/bin/cdxgen-secure.d.ts.map +1 -0
- package/types/bin/repl.d.ts.map +1 -1
- package/types/lib/audit/index.d.ts.map +1 -1
- package/types/lib/cli/bomAssembly.d.ts +9 -2
- package/types/lib/cli/bomAssembly.d.ts.map +1 -1
- package/types/lib/cli/cliOptions.d.ts +43 -0
- package/types/lib/cli/cliOptions.d.ts.map +1 -1
- package/types/lib/cli/index.d.ts.map +1 -1
- package/types/lib/cli/jsBom.d.ts.map +1 -1
- package/types/lib/cli/jvmBom.d.ts +44 -1
- package/types/lib/cli/jvmBom.d.ts.map +1 -1
- package/types/lib/cli/managedBom.d.ts +7 -4
- package/types/lib/cli/managedBom.d.ts.map +1 -1
- package/types/lib/cli/nativeBom.d.ts +3 -1
- package/types/lib/cli/nativeBom.d.ts.map +1 -1
- package/types/lib/core/activity.d.ts.map +1 -1
- package/types/lib/core/env.d.ts +27 -2
- package/types/lib/core/env.d.ts.map +1 -1
- package/types/lib/core/fs.d.ts.map +1 -1
- package/types/lib/core/httpClient.d.ts +13 -8
- package/types/lib/core/httpClient.d.ts.map +1 -1
- package/types/lib/core/pluginRun.d.ts +97 -0
- package/types/lib/core/pluginRun.d.ts.map +1 -0
- package/types/lib/core/processTree.d.ts +36 -0
- package/types/lib/core/processTree.d.ts.map +1 -0
- package/types/lib/core/projectConfig.d.ts.map +1 -1
- package/types/lib/core/projectTooling.d.ts +41 -0
- package/types/lib/core/projectTooling.d.ts.map +1 -0
- package/types/lib/core/propertySanitizer.d.ts +26 -0
- package/types/lib/core/propertySanitizer.d.ts.map +1 -1
- package/types/lib/core/runState.d.ts +29 -0
- package/types/lib/core/runState.d.ts.map +1 -0
- package/types/lib/core/toml.d.ts +20 -0
- package/types/lib/core/toml.d.ts.map +1 -0
- package/types/lib/ecosystems/asarutils.d.ts.map +1 -1
- package/types/lib/ecosystems/bunutils.d.ts.map +1 -1
- package/types/lib/ecosystems/cargoCache.d.ts +12 -0
- package/types/lib/ecosystems/cargoCache.d.ts.map +1 -1
- package/types/lib/ecosystems/cmakeResolver.d.ts +5 -3
- package/types/lib/ecosystems/cmakeResolver.d.ts.map +1 -1
- package/types/lib/ecosystems/cppBuildContext.d.ts +55 -0
- package/types/lib/ecosystems/cppBuildContext.d.ts.map +1 -0
- package/types/lib/ecosystems/cppEvidence.d.ts +19 -3
- package/types/lib/ecosystems/cppEvidence.d.ts.map +1 -1
- package/types/lib/ecosystems/cppIncludeResolver.d.ts +92 -0
- package/types/lib/ecosystems/cppIncludeResolver.d.ts.map +1 -0
- package/types/lib/ecosystems/denoutils.d.ts +9 -3
- package/types/lib/ecosystems/denoutils.d.ts.map +1 -1
- package/types/lib/ecosystems/ecosystems.d.ts +62 -13
- package/types/lib/ecosystems/ecosystems.d.ts.map +1 -1
- package/types/lib/ecosystems/golem.d.ts +81 -1
- package/types/lib/ecosystems/golem.d.ts.map +1 -1
- package/types/lib/ecosystems/gradleutils.d.ts +59 -7
- package/types/lib/ecosystems/gradleutils.d.ts.map +1 -1
- package/types/lib/ecosystems/jsEvidence.d.ts.map +1 -1
- package/types/lib/ecosystems/kosi.d.ts.map +1 -1
- package/types/lib/ecosystems/npmutils.d.ts +15 -0
- package/types/lib/ecosystems/npmutils.d.ts.map +1 -1
- package/types/lib/ecosystems/parsers-dotnet.d.ts +155 -5
- package/types/lib/ecosystems/parsers-dotnet.d.ts.map +1 -1
- package/types/lib/ecosystems/parsers-elm.d.ts.map +1 -1
- package/types/lib/ecosystems/parsers-gleam.d.ts.map +1 -1
- package/types/lib/ecosystems/parsers-go.d.ts +119 -5
- package/types/lib/ecosystems/parsers-go.d.ts.map +1 -1
- package/types/lib/ecosystems/parsers-js.d.ts +6 -1
- package/types/lib/ecosystems/parsers-js.d.ts.map +1 -1
- package/types/lib/ecosystems/parsers-julia.d.ts.map +1 -1
- package/types/lib/ecosystems/parsers-jvm.d.ts +74 -3
- package/types/lib/ecosystems/parsers-jvm.d.ts.map +1 -1
- package/types/lib/ecosystems/parsers-misc.d.ts +21 -59
- package/types/lib/ecosystems/parsers-misc.d.ts.map +1 -1
- package/types/lib/ecosystems/parsers-python.d.ts +57 -6
- package/types/lib/ecosystems/parsers-python.d.ts.map +1 -1
- package/types/lib/ecosystems/parsers-terraform.d.ts +38 -21
- package/types/lib/ecosystems/parsers-terraform.d.ts.map +1 -1
- package/types/lib/ecosystems/pythonutils.d.ts +26 -1
- package/types/lib/ecosystems/pythonutils.d.ts.map +1 -1
- package/types/lib/ecosystems/remote/huggingface.d.ts.map +1 -1
- package/types/lib/ecosystems/rubyutils.d.ts +21 -1
- package/types/lib/ecosystems/rubyutils.d.ts.map +1 -1
- package/types/lib/ecosystems/rusi.d.ts.map +1 -1
- package/types/lib/ecosystems/sbtutils.d.ts +88 -2
- package/types/lib/ecosystems/sbtutils.d.ts.map +1 -1
- package/types/lib/ecosystems/scalacliutils.d.ts +56 -0
- package/types/lib/ecosystems/scalacliutils.d.ts.map +1 -0
- package/types/lib/ecosystems/scalasem.d.ts +311 -0
- package/types/lib/ecosystems/scalasem.d.ts.map +1 -0
- package/types/lib/ecosystems/terraformRegistry.d.ts +9 -0
- package/types/lib/ecosystems/terraformRegistry.d.ts.map +1 -0
- package/types/lib/ecosystems/utils.d.ts +2 -2
- package/types/lib/ecosystems/utils.d.ts.map +1 -1
- package/types/lib/ecosystems/vendoredCode.d.ts +32 -0
- package/types/lib/ecosystems/vendoredCode.d.ts.map +1 -0
- package/types/lib/evinser/evinser.d.ts +100 -8
- package/types/lib/evinser/evinser.d.ts.map +1 -1
- package/types/lib/evinser/swiftsem.d.ts +10 -0
- package/types/lib/evinser/swiftsem.d.ts.map +1 -1
- package/types/lib/helpers/bomSigner.d.ts +80 -4
- package/types/lib/helpers/bomSigner.d.ts.map +1 -1
- package/types/lib/inventory/agentSkillSpec.d.ts +13 -0
- package/types/lib/inventory/agentSkillSpec.d.ts.map +1 -0
- package/types/lib/inventory/aiCollector.d.ts.map +1 -1
- package/types/lib/inventory/analyzer.d.ts.map +1 -1
- package/types/lib/inventory/apkInstalledDb.d.ts +42 -0
- package/types/lib/inventory/apkInstalledDb.d.ts.map +1 -0
- package/types/lib/inventory/atomUtils.d.ts +96 -10
- package/types/lib/inventory/atomUtils.d.ts.map +1 -1
- package/types/lib/inventory/auditCategories.d.ts +3 -0
- package/types/lib/inventory/auditCategories.d.ts.map +1 -1
- package/types/lib/inventory/buildToolRateLimit.d.ts +38 -0
- package/types/lib/inventory/buildToolRateLimit.d.ts.map +1 -0
- package/types/lib/inventory/cacheCommands.d.ts +2 -1
- package/types/lib/inventory/cacheCommands.d.ts.map +1 -1
- package/types/lib/inventory/cacheDir.d.ts +12 -4
- package/types/lib/inventory/cacheDir.d.ts.map +1 -1
- package/types/lib/inventory/certificates.d.ts +205 -0
- package/types/lib/inventory/certificates.d.ts.map +1 -0
- package/types/lib/inventory/cmakeBuildDirs.d.ts +58 -0
- package/types/lib/inventory/cmakeBuildDirs.d.ts.map +1 -0
- package/types/lib/inventory/communityAiConfigParser.d.ts.map +1 -1
- package/types/lib/inventory/deps.d.ts +61 -2
- package/types/lib/inventory/deps.d.ts.map +1 -1
- package/types/lib/inventory/display.d.ts +18 -0
- package/types/lib/inventory/display.d.ts.map +1 -1
- package/types/lib/inventory/dosai.d.ts +202 -14
- package/types/lib/inventory/dosai.d.ts.map +1 -1
- package/types/lib/inventory/dosaiParsers.d.ts +53 -7
- package/types/lib/inventory/dosaiParsers.d.ts.map +1 -1
- package/types/lib/inventory/dynamic.d.ts +16 -1
- package/types/lib/inventory/dynamic.d.ts.map +1 -1
- package/types/lib/inventory/envcontext.d.ts +40 -2
- package/types/lib/inventory/envcontext.d.ts.map +1 -1
- package/types/lib/inventory/evidenceUtils.d.ts +48 -14
- package/types/lib/inventory/evidenceUtils.d.ts.map +1 -1
- package/types/lib/inventory/fetchBatch.d.ts +83 -14
- package/types/lib/inventory/fetchBatch.d.ts.map +1 -1
- package/types/lib/inventory/fetchDiskCache.d.ts +169 -0
- package/types/lib/inventory/fetchDiskCache.d.ts.map +1 -0
- package/types/lib/inventory/forgeEnricher.d.ts.map +1 -1
- package/types/lib/inventory/formulationParsers.d.ts.map +1 -1
- package/types/lib/inventory/goBuildInfo.d.ts +10 -0
- package/types/lib/inventory/goBuildInfo.d.ts.map +1 -0
- package/types/lib/inventory/hbom.d.ts.map +1 -1
- package/types/lib/inventory/hbomAnalysis.d.ts +10 -0
- package/types/lib/inventory/hbomAnalysis.d.ts.map +1 -1
- package/types/lib/inventory/hostTopology.d.ts.map +1 -1
- package/types/lib/inventory/jvmLocalRepos.d.ts +178 -0
- package/types/lib/inventory/jvmLocalRepos.d.ts.map +1 -0
- package/types/lib/inventory/mcpConfigParser.d.ts.map +1 -1
- package/types/lib/inventory/osPackagePurl.d.ts +99 -0
- package/types/lib/inventory/osPackagePurl.d.ts.map +1 -0
- package/types/lib/inventory/osPackageResolver.d.ts +6 -2
- package/types/lib/inventory/osPackageResolver.d.ts.map +1 -1
- package/types/lib/inventory/osinfo.d.ts +31 -6
- package/types/lib/inventory/osinfo.d.ts.map +1 -1
- package/types/lib/inventory/osqueryTransform.d.ts +51 -0
- package/types/lib/inventory/osqueryTransform.d.ts.map +1 -1
- package/types/lib/inventory/parentSelection.d.ts +34 -0
- package/types/lib/inventory/parentSelection.d.ts.map +1 -0
- package/types/lib/inventory/phpBuildInfo.d.ts +142 -0
- package/types/lib/inventory/phpBuildInfo.d.ts.map +1 -0
- package/types/lib/inventory/phpHostProbe.d.ts +35 -0
- package/types/lib/inventory/phpHostProbe.d.ts.map +1 -0
- package/types/lib/inventory/rootfsCerts.d.ts +27 -0
- package/types/lib/inventory/rootfsCerts.d.ts.map +1 -0
- package/types/lib/inventory/rustFormulationParser.d.ts.map +1 -1
- package/types/lib/inventory/scalaCoords.d.ts +80 -0
- package/types/lib/inventory/scalaCoords.d.ts.map +1 -0
- package/types/lib/inventory/source.d.ts +28 -0
- package/types/lib/inventory/source.d.ts.map +1 -1
- package/types/lib/inventory/spdx.d.ts +24 -0
- package/types/lib/inventory/spdx.d.ts.map +1 -1
- package/types/lib/inventory/traceRunner.d.ts +16 -1
- package/types/lib/inventory/traceRunner.d.ts.map +1 -1
- package/types/lib/inventory/tracedCrypto.d.ts +64 -0
- package/types/lib/inventory/tracedCrypto.d.ts.map +1 -0
- package/types/lib/managers/binary.d.ts +10 -0
- package/types/lib/managers/binary.d.ts.map +1 -1
- package/types/lib/managers/docker.d.ts +12 -0
- package/types/lib/managers/docker.d.ts.map +1 -1
- package/types/lib/managers/oci.d.ts +3 -1
- package/types/lib/managers/oci.d.ts.map +1 -1
- package/types/lib/parsers/cmakeCache.d.ts +16 -0
- package/types/lib/parsers/cmakeCache.d.ts.map +1 -1
- package/types/lib/parsers/cmakeLists.d.ts +2 -1
- package/types/lib/parsers/cmakeLists.d.ts.map +1 -1
- package/types/lib/parsers/cmakePresets.d.ts +78 -0
- package/types/lib/parsers/cmakePresets.d.ts.map +1 -0
- package/types/lib/parsers/compileCommands.d.ts +115 -0
- package/types/lib/parsers/compileCommands.d.ts.map +1 -0
- package/types/lib/parsers/email.d.ts +19 -0
- package/types/lib/parsers/email.d.ts.map +1 -0
- package/types/lib/parsers/largeJson.d.ts +13 -0
- package/types/lib/parsers/largeJson.d.ts.map +1 -1
- package/types/lib/parsers/strictJson.d.ts +46 -0
- package/types/lib/parsers/strictJson.d.ts.map +1 -0
- package/types/lib/parsers/terraformConfig.d.ts +70 -0
- package/types/lib/parsers/terraformConfig.d.ts.map +1 -0
- package/types/lib/parsers/terraformSource.d.ts +66 -0
- package/types/lib/parsers/terraformSource.d.ts.map +1 -0
- package/types/lib/server/server.d.ts +8 -0
- package/types/lib/server/server.d.ts.map +1 -1
- package/types/lib/stages/postgen/annotator.d.ts.map +1 -1
- package/types/lib/stages/postgen/introspection/reflect.d.ts.map +1 -1
- package/types/lib/stages/postgen/postgen.d.ts.map +1 -1
- package/types/lib/stages/postgen/ruleEngine.d.ts +7 -4
- package/types/lib/stages/postgen/ruleEngine.d.ts.map +1 -1
- package/types/lib/stages/postgen/specVersionCompat.d.ts.map +1 -1
- package/types/lib/stages/pregen/pregen.d.ts +14 -1
- package/types/lib/stages/pregen/pregen.d.ts.map +1 -1
- package/types/lib/validator/bomValidator.d.ts.map +1 -1
- package/types/lib/validator/index.d.ts +8 -0
- package/types/lib/validator/index.d.ts.map +1 -1
- package/types/lib/validator/reporters/json.d.ts.map +1 -1
- package/lib/third-party/arborist/snapshots/calc-dep-flags.test.cjs +0 -462
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The purl types an OS scan builds from what a package manager reports.
|
|
3
|
+
* deb, rpm, apk and alpm belong to a distro; brew, macports, snap and flatpak
|
|
4
|
+
* belong to none. brew, macports, snap and flatpak are not purl-spec types;
|
|
5
|
+
* cdx-purl builds them as it builds `pkg:chocolatey`.
|
|
6
|
+
*/
|
|
7
|
+
export declare const OS_PACKAGE_PURL_TYPES: Set<string>;
|
|
8
|
+
/**
|
|
9
|
+
* Whether a purl type is one of the OS package managers handled here.
|
|
10
|
+
*
|
|
11
|
+
* @param {string|undefined} type Purl type
|
|
12
|
+
* @returns {boolean} true for the types in OS_PACKAGE_PURL_TYPES
|
|
13
|
+
*/
|
|
14
|
+
export declare function isOsPackagePurlType(type: string | undefined): boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Whether a value names an architecture. rpm says `(none)` and trivy says
|
|
17
|
+
* `None` for a package that has none, such as an rpm's `gpg-pubkey` key record;
|
|
18
|
+
* neither is an architecture, and neither belongs in a purl.
|
|
19
|
+
*
|
|
20
|
+
* @param {string|undefined|null} arch Architecture as a package manager reports it
|
|
21
|
+
* @returns {boolean} true for a real architecture
|
|
22
|
+
*/
|
|
23
|
+
export declare function isRealArchitecture(arch: string | undefined | null): boolean;
|
|
24
|
+
/**
|
|
25
|
+
* The epoch of an OS package, as the `epoch` qualifier carries it.
|
|
26
|
+
*
|
|
27
|
+
* An rpm keeps its epoch in a field of its own. A deb keeps it in its version
|
|
28
|
+
* (`2:93`), so the version is read first. Epoch 0 and no epoch are the same,
|
|
29
|
+
* and apk and Homebrew packages have none.
|
|
30
|
+
*
|
|
31
|
+
* @param {{type: string, version?: string, epoch?: string|number}} pkg Package
|
|
32
|
+
* @returns {string|undefined} The epoch without leading zeros, or undefined
|
|
33
|
+
*/
|
|
34
|
+
export declare function osPackageEpoch(pkg: {
|
|
35
|
+
type: string;
|
|
36
|
+
version?: string;
|
|
37
|
+
epoch?: string | number;
|
|
38
|
+
}): string | undefined;
|
|
39
|
+
/**
|
|
40
|
+
* The version an OS package carries on its component and in its purl.
|
|
41
|
+
*
|
|
42
|
+
* - rpm: `[epoch:]version-release`, the form the container scan writes. The
|
|
43
|
+
* purl spec keeps the epoch out of an rpm version, but the container scan
|
|
44
|
+
* puts it in the version as well as in the `epoch` qualifier, and an OBOM must
|
|
45
|
+
* name the package the same way.
|
|
46
|
+
* - deb: the version exactly as dpkg reports it, epoch included.
|
|
47
|
+
* - macports: `version_revision`, the form `port installed` prints.
|
|
48
|
+
* - apk, alpm, brew, snap and flatpak: the version as it is. A pacman version
|
|
49
|
+
* already holds its epoch and release (`1:1.3.2-4`).
|
|
50
|
+
*
|
|
51
|
+
* @param {{type: string, version?: string, release?: string, epoch?: string|number, revision?: string|number}} pkg Package
|
|
52
|
+
* @returns {string} The version, or an empty string when the package has none
|
|
53
|
+
*/
|
|
54
|
+
export declare function osPackageVersion(pkg: {
|
|
55
|
+
type: string;
|
|
56
|
+
version?: string;
|
|
57
|
+
release?: string;
|
|
58
|
+
epoch?: string | number;
|
|
59
|
+
revision?: string | number;
|
|
60
|
+
}): string;
|
|
61
|
+
/**
|
|
62
|
+
* Build the purl of an OS package.
|
|
63
|
+
*
|
|
64
|
+
* deb, rpm and apk purls take their vendor (`ubuntu`, `almalinux`, `alpine`,
|
|
65
|
+
* `wolfi`) and the `distro` and `distro_name` qualifiers from the distro, plus
|
|
66
|
+
* `arch` and `epoch` from the package. alpm purls take the vendor (`arch`,
|
|
67
|
+
* `manjaro`) and `arch` only: that is all the alpm type defines, and an Arch
|
|
68
|
+
* system is rolling, with no release to name. A qualifier with no value is
|
|
69
|
+
* left out. brew, macports and snap purls carry neither vendor nor qualifiers;
|
|
70
|
+
* a flatpak purl carries the `arch` and `branch` of the flatpak ref.
|
|
71
|
+
*
|
|
72
|
+
* @param {Object} pkg The package
|
|
73
|
+
* @param {string} pkg.type One of OS_PACKAGE_PURL_TYPES
|
|
74
|
+
* @param {string} pkg.name Package name; a flatpak's application ID
|
|
75
|
+
* @param {string} [pkg.version] deb: the dpkg version. rpm: the version tag only. apk: version-rN. macports: the version without its revision.
|
|
76
|
+
* @param {string} [pkg.release] rpm release tag
|
|
77
|
+
* @param {string|number} [pkg.epoch] rpm epoch tag
|
|
78
|
+
* @param {string|number} [pkg.revision] MacPorts revision
|
|
79
|
+
* @param {string} [pkg.arch] Package architecture
|
|
80
|
+
* @param {string} [pkg.branch] flatpak branch (`stable`, `48`)
|
|
81
|
+
* @param {{namespace?: string, distroId?: string, distroName?: string}} [distro]
|
|
82
|
+
* What getDistroInfo() reports; read from the host's os-release when left out
|
|
83
|
+
* @returns {string|null} The purl, or null when the parts do not form a valid one
|
|
84
|
+
*/
|
|
85
|
+
export declare function buildOsPackagePurl(pkg: {
|
|
86
|
+
type: string;
|
|
87
|
+
name: string;
|
|
88
|
+
version?: string;
|
|
89
|
+
release?: string;
|
|
90
|
+
epoch?: string | number;
|
|
91
|
+
revision?: string | number;
|
|
92
|
+
arch?: string;
|
|
93
|
+
branch?: string;
|
|
94
|
+
}, distro?: {
|
|
95
|
+
namespace?: string;
|
|
96
|
+
distroId?: string;
|
|
97
|
+
distroName?: string;
|
|
98
|
+
}): string | null;
|
|
99
|
+
//# sourceMappingURL=osPackagePurl.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"osPackagePurl.d.ts","sourceRoot":"","sources":["../../../lib/inventory/osPackagePurl.js"],"names":[],"mappings":"AAiBA;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,aAShC,CAAC;AAEH;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAH7B,MAAM,GAAC,SAGsB,GAF3B,OAAO,CAInB;AAED;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAH5B,MAAM,GAAC,SAAS,GAAC,IAGW,GAF1B,OAAO,CAKnB;AAqCD;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAHvB;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,GAAC,MAAM,CAAA;CAG/B,GAFrB,MAAM,GAAC,SAAS,CAe5B;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAHzB;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,GAAC,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,GAAC,MAAM,CAAA;CAGzE,GAFvB,MAAM,CA6BlB;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAZnC;IAAoB,IAAI,EAAhB,MAAM,CACd;IAAoB,IAAI,EAAhB,MAAM,CACd;IAAqB,OAAO,AAA5B,CACA,EADQ,MAAM,CACd;IAAqB,OAAO,AAA5B,CACA,EADQ,MAAM,CACd;IAA4B,KAAK,AAAjC,CACA,EADQ,MAAM,GAAC,MAAM,CACrB;IAA4B,QAAQ,AAApC,CACA,EADQ,MAAM,GAAC,MAAM,CACrB;IAAqB,IAAI,AAAzB,CACA,EADQ,MAAM,CACd;IAAqB,MAAM,AAA3B,CACA,EADQ,MAAM,CACd;CAImC,EAAE,MAAM,AAJ3C,CAEA,EAFQ;IAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,CAAA;CAIxB,GAFjC,MAAM,GAAC,IAAI,CA4DvB"}
|
|
@@ -7,13 +7,14 @@ export declare function _resetOsInfoCache(): void;
|
|
|
7
7
|
* correctly computed purl with distro qualifiers derived from /etc/os-release.
|
|
8
8
|
*
|
|
9
9
|
* @param {string} filePath - Absolute path to the library file
|
|
10
|
-
* @returns {{ name: string, version: string, arch: string, type: string, purl: string } | undefined}
|
|
10
|
+
* @returns {{ name: string, version: string, arch: string, type: string, epoch?: string, purl: string } | undefined}
|
|
11
11
|
*/
|
|
12
12
|
export declare function resolvePackageForFile(filePath: string): {
|
|
13
13
|
name: string;
|
|
14
14
|
version: string;
|
|
15
15
|
arch: string;
|
|
16
16
|
type: string;
|
|
17
|
+
epoch?: string;
|
|
17
18
|
purl: string;
|
|
18
19
|
} | undefined;
|
|
19
20
|
/**
|
|
@@ -42,8 +43,11 @@ export declare function collectExecutables(basePath: any, binPaths: any, exclude
|
|
|
42
43
|
* @param ldConf {String} Config file used by ldconfig to locate additional paths
|
|
43
44
|
* @param ldConfDirPattern {String} Config directory that can contain more .conf files for ldconfig
|
|
44
45
|
* @param excludePaths {Array[String]} Container-relative paths that should be excluded from the result set
|
|
46
|
+
* @param extraLibGlobs {Array[String]} Extra container-relative globs for files
|
|
47
|
+
* the default paths miss, such as libphp*.so under Apache's modules
|
|
48
|
+
* directory. The existing globs are unchanged; this adds candidates only.
|
|
45
49
|
*
|
|
46
50
|
* @return {Array[String]} List of executables
|
|
47
51
|
*/
|
|
48
|
-
export declare function collectSharedLibs(basePath: any, libPaths: any, ldConf: string, ldConfDirPattern: string, excludePaths?: any): any;
|
|
52
|
+
export declare function collectSharedLibs(basePath: any, libPaths: any, ldConf: string, ldConfDirPattern: string, excludePaths?: any, extraLibGlobs?: any): any;
|
|
49
53
|
//# sourceMappingURL=osPackageResolver.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"osPackageResolver.d.ts","sourceRoot":"","sources":["../../../lib/inventory/osPackageResolver.js"],"names":[],"mappings":"AAwBA;;GAEG;AACH,wBAAgB,iBAAiB,SAGhC;
|
|
1
|
+
{"version":3,"file":"osPackageResolver.d.ts","sourceRoot":"","sources":["../../../lib/inventory/osPackageResolver.js"],"names":[],"mappings":"AAwBA;;GAEG;AACH,wBAAgB,iBAAiB,SAGhC;AAsDD;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CAAC,QAAQ,EAHnC,MAGmC,GAFjC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,CA8BnH;AAuGD;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAJ9B,MAI8B,EAAE,UAAU,EAH1C,MAAM,EAGoC,GAFxC,MAAM,GAAC,SAAS,CA+B5B;AAED;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,KAAA,EAAE,QAAQ,KAAA,EAAE,YAAY,MAAK,OAqEvE;AAcD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,iBAAiB,CAC/B,QAAQ,KAAA,EACR,QAAQ,KAAA,EACR,MAAM,QAAA,EACN,gBAAgB,QAAA,EAChB,YAAY,MAAK,EACjB,aAAa,MAAK,OAiGnB"}
|
|
@@ -46,14 +46,34 @@ export declare const OS_DISTRO_ALIAS: {
|
|
|
46
46
|
"ubuntu-24.10": string;
|
|
47
47
|
"ubuntu-25.04": string;
|
|
48
48
|
"ubuntu-25.10": string;
|
|
49
|
+
"ubuntu-26.04": string;
|
|
50
|
+
"ubuntu-26.10": string;
|
|
49
51
|
"debian-15": string;
|
|
50
52
|
"debian-14": string;
|
|
51
53
|
"debian-14.5": string;
|
|
52
54
|
"debian-13": string;
|
|
55
|
+
"debian-13.7": string;
|
|
56
|
+
"debian-13.6": string;
|
|
53
57
|
"debian-13.5": string;
|
|
58
|
+
"debian-13.4": string;
|
|
59
|
+
"debian-13.3": string;
|
|
60
|
+
"debian-13.2": string;
|
|
61
|
+
"debian-13.1": string;
|
|
54
62
|
"debian-12": string;
|
|
55
|
-
"debian-12.
|
|
63
|
+
"debian-12.15": string;
|
|
64
|
+
"debian-12.14": string;
|
|
65
|
+
"debian-12.13": string;
|
|
66
|
+
"debian-12.12": string;
|
|
67
|
+
"debian-12.11": string;
|
|
68
|
+
"debian-12.10": string;
|
|
69
|
+
"debian-12.9": string;
|
|
70
|
+
"debian-12.8": string;
|
|
71
|
+
"debian-12.7": string;
|
|
56
72
|
"debian-12.6": string;
|
|
73
|
+
"debian-12.5": string;
|
|
74
|
+
"debian-12.4": string;
|
|
75
|
+
"debian-12.2": string;
|
|
76
|
+
"debian-12.1": string;
|
|
57
77
|
"debian-11": string;
|
|
58
78
|
"debian-11.5": string;
|
|
59
79
|
"debian-10": string;
|
|
@@ -179,15 +199,20 @@ export declare function _resetOsReleaseCache(): void;
|
|
|
179
199
|
* Derive structured distro information from an os-release file.
|
|
180
200
|
*
|
|
181
201
|
* Returns an object with:
|
|
182
|
-
* - purlType {string} "deb" | "apk" | "rpm"
|
|
202
|
+
* - purlType {string} "deb" | "apk" | "rpm" | "alpm" (Arch and the
|
|
203
|
+
* distros built on it)
|
|
183
204
|
* - namespace {string} canonical purl namespace (e.g. "ubuntu", "alpine",
|
|
184
205
|
* "azure-linux" for both Azure Linux and CBL-Mariner)
|
|
185
206
|
* - distroId {string} ID + "-" + VERSION_ID with a canonical vendor
|
|
186
|
-
* prefix (e.g. "ubuntu-22.04", "azure-linux-3.0"
|
|
187
|
-
*
|
|
207
|
+
* prefix (e.g. "ubuntu-22.04", "azure-linux-3.0",
|
|
208
|
+
* "alpine-3.24.3")
|
|
209
|
+
* - distroName {string} release codename, or a token OS_DISTRO_ALIAS knows
|
|
210
|
+
* (e.g. "jammy", "rhel", "alpine-3.24"); empty when
|
|
211
|
+
* the distro has neither
|
|
188
212
|
*
|
|
189
|
-
*
|
|
190
|
-
*
|
|
213
|
+
* lib/managers/binary.js getOSPackages() reads its distro from here, so a
|
|
214
|
+
* container scan and an OBOM run on the same system give a package the same
|
|
215
|
+
* `distro` and `distro_name` qualifiers.
|
|
191
216
|
*
|
|
192
217
|
* @param {string} [root="/"] - Filesystem root to look for os-release.
|
|
193
218
|
* @returns {{ purlType: string, namespace: string, distroId: string, distroName: string }}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"osinfo.d.ts","sourceRoot":"","sources":["../../../lib/inventory/osinfo.js"],"names":[],"mappings":"AAGA;;;GAGG;AACH,eAAO,MAAM,eAAe;IA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IACF,IAAI;IACJ,aAAa;CACd,CAAC;AASF;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,SAAS,EAHrC,MAGqC,GAFnC,OAAO,CAInB;AAMD;;;;;;;;GAQG;AACH,wBAAgB,wBAAwB,CAAC,SAAS,EAHvC,MAGuC,GAFrC,MAAM,CAYlB;AAQD;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAAC,IAAI,AAJ/B,CAEA,EAFQ,MAI6B,GAF3B,MAAM,CAqClB;AAGD;;GAEG;AACH,wBAAgB,oBAAoB,SAEnC;AAED
|
|
1
|
+
{"version":3,"file":"osinfo.d.ts","sourceRoot":"","sources":["../../../lib/inventory/osinfo.js"],"names":[],"mappings":"AAGA;;;GAGG;AACH,eAAO,MAAM,eAAe;IAC1B,aAAa;IACb,aAAa;IACb,aAAa;IACb,aAAa;IACb,aAAa;IACb,aAAa;IACb,aAAa;IACb,aAAa;IACb,aAAa;IACb,aAAa;IACb,aAAa;IACb,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,WAAW;IACX,WAAW;IACX,aAAa;IACb,WAAW;IACX,aAAa;IACb,aAAa;IACb,aAAa;IACb,aAAa;IACb,aAAa;IACb,aAAa;IACb,aAAa;IACb,WAAW;IACX,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,aAAa;IACb,aAAa;IACb,aAAa;IACb,aAAa;IACb,aAAa;IACb,aAAa;IACb,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CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,CAyIzF"}
|
|
@@ -81,4 +81,55 @@ export declare function shouldCreateOsQueryPurl(componentType: string): boolean;
|
|
|
81
81
|
* @returns {string|null} Canonical purl string, or `null` when the parts do not form a valid purl
|
|
82
82
|
*/
|
|
83
83
|
export declare function createOsQueryPurl(purlType: string, group: string | null, name: string, version: string, qualifiers: Object | null, subpath: string | null): string | null;
|
|
84
|
+
/**
|
|
85
|
+
* The version and purl of a row from an OS package table: `deb_packages`,
|
|
86
|
+
* `rpm_packages`, `pacman_packages`, `homebrew_packages`, `macports_packages`,
|
|
87
|
+
* `snap_packages`, `flatpak_packages` or the rows of the apk database.
|
|
88
|
+
*
|
|
89
|
+
* Such a row is named the way the package manager's own scan names it: deb,
|
|
90
|
+
* rpm and apk with the vendor and the `arch`, `distro`, `distro_name` and
|
|
91
|
+
* `epoch` qualifiers of the container scan, an rpm version joined to its
|
|
92
|
+
* release, a MacPorts version joined to its revision, a flatpak by its
|
|
93
|
+
* application ID with the `arch` and `branch` of its ref. A row's `path`,
|
|
94
|
+
* `admindir` or source file is not a path inside the package, so none of them
|
|
95
|
+
* becomes a subpath.
|
|
96
|
+
*
|
|
97
|
+
* @param {string} purlType One of OS_PACKAGE_PURL_TYPES
|
|
98
|
+
* @param {Object} res osquery row
|
|
99
|
+
* @param {string} name Component name derived from the row
|
|
100
|
+
* @param {Object} [distro] What getDistroInfo() reports; the host's by default
|
|
101
|
+
* @returns {{version: string, purl: string|null}} The component version and the purl, which is null when the row cannot be expressed as one
|
|
102
|
+
*/
|
|
103
|
+
export declare function createOsQueryPackageIdentity(purlType: string, res: Object, name: string, distro?: Object): {
|
|
104
|
+
version: string;
|
|
105
|
+
purl: string | null;
|
|
106
|
+
};
|
|
107
|
+
/**
|
|
108
|
+
* The columns of an OS package row that give its licence and its home page.
|
|
109
|
+
* They become the component's `licenses` and a `website` reference rather than
|
|
110
|
+
* properties. `separator` splits a licence column that lists several: pacman
|
|
111
|
+
* keeps one licence per entry, which osquery joins with commas.
|
|
112
|
+
*/
|
|
113
|
+
export declare const OS_PACKAGE_LICENSE_COLUMNS: {
|
|
114
|
+
alpm: {
|
|
115
|
+
license: string;
|
|
116
|
+
separator: string;
|
|
117
|
+
website: string;
|
|
118
|
+
};
|
|
119
|
+
snap: {
|
|
120
|
+
license: string;
|
|
121
|
+
};
|
|
122
|
+
flatpak: {
|
|
123
|
+
license: string;
|
|
124
|
+
website: string;
|
|
125
|
+
};
|
|
126
|
+
};
|
|
127
|
+
/**
|
|
128
|
+
* The property name an OS package table column is emitted under.
|
|
129
|
+
*
|
|
130
|
+
* @param {string|undefined} purlType Purl type of the table
|
|
131
|
+
* @param {string} column Column name
|
|
132
|
+
* @returns {string|undefined} The property name, or undefined when the column is not emitted
|
|
133
|
+
*/
|
|
134
|
+
export declare function osPackagePropertyName(purlType: string | undefined, column: string): string | undefined;
|
|
84
135
|
//# sourceMappingURL=osqueryTransform.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"osqueryTransform.d.ts","sourceRoot":"","sources":["../../../lib/inventory/osqueryTransform.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"osqueryTransform.d.ts","sourceRoot":"","sources":["../../../lib/inventory/osqueryTransform.js"],"names":[],"mappings":"AAIA;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAH7B,MAG6B,GAF3B,MAAM,GAAC,SAAS,CAa5B;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAL1B,MAK0B,EAAE,YAAY,EAJxC,OAIwC,EAAE,SAAS,EAHnD,MAGmD,GAFjD,MAAM,GAAC,SAAS,CAkB5B;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,GAAG,EAH/B,MAG+B,GAF7B,MAAM,CAalB;AAED;;;;;GAKG;AACH,wBAAgB,wBAAwB,CAAC,GAAG,EAHjC,MAGiC,GAF/B,MAAM,CAelB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ACH,wBAAgB,qBAAqB,CAAC,QAAQ,EAJnC,MAAM,GAAC,SAI4B,EAAE,MAAM,EAH3C,MAG2C,GAFzC,MAAM,GAAC,SAAS,CAY5B"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Which detected project becomes the parent (`metadata.component`) when one
|
|
3
|
+
* scan covers several ecosystems and no parent was given.
|
|
4
|
+
*
|
|
5
|
+
* Each ecosystem detects its own project from its own manifest. The project
|
|
6
|
+
* whose manifest sits at the scan root describes the repository; one found
|
|
7
|
+
* deeper is a part of it (a web client in `tools/ui/`, a helper script's
|
|
8
|
+
* `pyproject.toml`). So candidates are ordered by how deep their ecosystem's
|
|
9
|
+
* manifests sit, the scan root first, and ties keep the ecosystem order the
|
|
10
|
+
* scan ran in.
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* How deep the shallowest manifest of an ecosystem sits under a scan root:
|
|
14
|
+
* 0 for one at the root itself, `Infinity` when there is none (or the
|
|
15
|
+
* ecosystem is not one this module knows).
|
|
16
|
+
*
|
|
17
|
+
* @param {string} root Scan root
|
|
18
|
+
* @param {string} purlType Purl type of the ecosystem
|
|
19
|
+
* @param {Object} options CLI options (exclusions)
|
|
20
|
+
* @returns {number}
|
|
21
|
+
*/
|
|
22
|
+
export declare function manifestDepth(root: string, purlType: string, options?: Object): number;
|
|
23
|
+
/**
|
|
24
|
+
* Order parent candidates by the depth of their ecosystem's manifests under
|
|
25
|
+
* the scan roots (the shallowest first). The sort is stable, so candidates of
|
|
26
|
+
* equal depth keep the order the ecosystems were scanned in.
|
|
27
|
+
*
|
|
28
|
+
* @param {Object[]} candidates Detected parent components, in scan order
|
|
29
|
+
* @param {string[]} roots Scan roots
|
|
30
|
+
* @param {Object} options CLI options
|
|
31
|
+
* @returns {Object[]} The candidates, reordered
|
|
32
|
+
*/
|
|
33
|
+
export declare function orderParentCandidates(candidates: Object[], roots: string[], options?: Object): Object[];
|
|
34
|
+
//# sourceMappingURL=parentSelection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parentSelection.d.ts","sourceRoot":"","sources":["../../../lib/inventory/parentSelection.js"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AA8DH;;;;;;;;;GASG;AACH,wBAAgB,aAAa,CAAC,IAAI,EALvB,MAKuB,EAAE,QAAQ,EAJjC,MAIiC,EAAE,OAAO,GAH1C,MAG+C,GAF7C,MAAM,CA2BlB;AAED;;;;;;;;;GASG;AACH,wBAAgB,qBAAqB,CAAC,UAAU,EALrC,MAAM,EAK+B,EAAE,KAAK,EAJ5C,MAAM,EAIsC,EAAE,OAAO,GAHrD,MAG0D,GAFxD,MAAM,EAAE,CA4BpB"}
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The most PHP-named files one scan opens in search of a build version.
|
|
3
|
+
*
|
|
4
|
+
* @type {number}
|
|
5
|
+
*/
|
|
6
|
+
export declare const MAX_PHP_PROBES: number;
|
|
7
|
+
/**
|
|
8
|
+
* Read the version a text starts with, in the grammar the build-version reader
|
|
9
|
+
* accepts: `8.4.27`, `8.5.0-dev`, `8.6.0RC3`. What follows the version must not
|
|
10
|
+
* continue it, so `8.4.26.1` and `8.4.26foo` parse to nothing. A distro
|
|
11
|
+
* revision such as Ubuntu's `8.1.2-1ubuntu2.14` is not an upstream version
|
|
12
|
+
* either, and parses to nothing rather than to a guess.
|
|
13
|
+
*
|
|
14
|
+
* @param {string} text text that begins with the version
|
|
15
|
+
* @returns {string|undefined} the version, or undefined when the text does not
|
|
16
|
+
* begin with one
|
|
17
|
+
*/
|
|
18
|
+
export declare function parsePhpVersion(text: string): string | undefined;
|
|
19
|
+
/**
|
|
20
|
+
* Read the version a PHP reports about itself, as `php -v` prints it. An
|
|
21
|
+
* upstream version parses as parsePhpVersion does. A version with a distro
|
|
22
|
+
* revision, such as Ubuntu's `8.1.2-1ubuntu2.14`, is kept whole and marked: it
|
|
23
|
+
* is what that PHP reports, but the distro backports fixes without changing the
|
|
24
|
+
* upstream part, so it must not be matched against upstream advisories.
|
|
25
|
+
*
|
|
26
|
+
* @param {string} text text that begins with the version
|
|
27
|
+
* @returns {{version: string, distroRevision: boolean}|undefined} the version,
|
|
28
|
+
* or undefined when the text does not begin with one
|
|
29
|
+
*/
|
|
30
|
+
export declare function parsePhpReportedVersion(text: string): {
|
|
31
|
+
version: string;
|
|
32
|
+
distroRevision: boolean;
|
|
33
|
+
} | undefined;
|
|
34
|
+
/**
|
|
35
|
+
* The package manager whose store a path lies in. Homebrew (`Cellar/<formula>/
|
|
36
|
+
* <version>/`), Nix (`nix/store/`) and Guix (`gnu/store/`) own everything under
|
|
37
|
+
* their stores, whatever links lead there, and a PHP they own is identified by
|
|
38
|
+
* their package, never as an unpackaged build.
|
|
39
|
+
*
|
|
40
|
+
* @param {string} filePath absolute or root-relative path, either separator
|
|
41
|
+
* @returns {string|undefined} `homebrew`, `nix` or `guix`, or undefined
|
|
42
|
+
*/
|
|
43
|
+
export declare function packageStoreOf(filePath: string): string | undefined;
|
|
44
|
+
/**
|
|
45
|
+
* Classify a file by its basename into a PHP SAPI, or undefined when the name
|
|
46
|
+
* is not one php-src installs.
|
|
47
|
+
*
|
|
48
|
+
* @param {string} fileName basename or path of the candidate
|
|
49
|
+
* @returns {string|undefined} cli, fpm, cgi, phpdbg, libphp or frankenphp
|
|
50
|
+
*/
|
|
51
|
+
export declare function classifyPhpSapi(fileName: string): string | undefined;
|
|
52
|
+
/**
|
|
53
|
+
* Read the PHP build version of a binary or shared library.
|
|
54
|
+
*
|
|
55
|
+
* @param {string} absPath absolute path
|
|
56
|
+
* @param {string|undefined} rootDir extracted root, when the file came from one
|
|
57
|
+
* @returns {{version: string, source: string}|undefined} source is `binary`
|
|
58
|
+
* or `php_version.h`
|
|
59
|
+
*/
|
|
60
|
+
export declare function readPhpBuildVersion(absPath: string, rootDir: string | undefined): {
|
|
61
|
+
version: string;
|
|
62
|
+
source: string;
|
|
63
|
+
} | undefined;
|
|
64
|
+
/**
|
|
65
|
+
* The CPE that lets a downstream scanner match a PHP version. NVD puts a
|
|
66
|
+
* pre-release suffix in the update field, e.g.
|
|
67
|
+
* cpe:2.3:a:php:php:8.5.0:rc1:*:*:*:*:*:* (NVD CPE dictionary).
|
|
68
|
+
*
|
|
69
|
+
* @param {string} version PHP version in the build-version grammar
|
|
70
|
+
* @returns {string} CPE 2.3 string
|
|
71
|
+
*/
|
|
72
|
+
export declare function phpCpe(version: string): string;
|
|
73
|
+
/**
|
|
74
|
+
* A PHP runtime is one `platform` component per distinct version, like the Go
|
|
75
|
+
* stdlib component. Its identity is `pkg:generic/php`: it is only used where no
|
|
76
|
+
* package manager owns PHP, or where a PATH probe cannot tell which one does.
|
|
77
|
+
*
|
|
78
|
+
* @param {string} version PHP version in the build-version grammar, or as a
|
|
79
|
+
* distro build reports it
|
|
80
|
+
* @param {Object} [options] options
|
|
81
|
+
* @param {boolean} [options.withCpe=true] false for a version with a distro
|
|
82
|
+
* revision, which no upstream CPE describes
|
|
83
|
+
* @returns {Object} component with `purl`, `bom-ref` and, unless left out, `cpe`
|
|
84
|
+
*/
|
|
85
|
+
export declare function createPhpRuntimeComponent(version: string, { withCpe }?: {
|
|
86
|
+
withCpe?: boolean;
|
|
87
|
+
}): Object;
|
|
88
|
+
/**
|
|
89
|
+
* The bom-ref of the runtime component for a version.
|
|
90
|
+
*
|
|
91
|
+
* @param {string} version PHP version in the build-version grammar
|
|
92
|
+
* @returns {string} bom-ref, which is the runtime's purl
|
|
93
|
+
*/
|
|
94
|
+
export declare function phpRuntimeRef(version: string): string;
|
|
95
|
+
/**
|
|
96
|
+
* The properties a PHP file component carries once its build version is known.
|
|
97
|
+
* They belong on unpackaged `file` components only: a package-owned PHP is
|
|
98
|
+
* identified by its package, and distro builds carry backported fixes under
|
|
99
|
+
* old version numbers, so the PHP-RCE audit rules that match these properties
|
|
100
|
+
* would raise false positives there.
|
|
101
|
+
*
|
|
102
|
+
* @param {{version: string, source: string}} build result of readPhpBuildVersion
|
|
103
|
+
* @param {string} sapi result of classifyPhpSapi
|
|
104
|
+
* @returns {{name: string, value: string}[]} properties to append
|
|
105
|
+
*/
|
|
106
|
+
export declare function phpBuildProperties(build: {
|
|
107
|
+
version: string;
|
|
108
|
+
source: string;
|
|
109
|
+
}, sapi: string): {
|
|
110
|
+
name: string;
|
|
111
|
+
value: string;
|
|
112
|
+
}[];
|
|
113
|
+
/**
|
|
114
|
+
* Start collecting the runtime components and edges of one scan.
|
|
115
|
+
*
|
|
116
|
+
* @returns {{runtimeComponents: Object[], dependencies: Object[], runtimeRefs: Set<string>}}
|
|
117
|
+
*/
|
|
118
|
+
export declare function createPhpRuntimeInventory(): {
|
|
119
|
+
runtimeComponents: Object[];
|
|
120
|
+
dependencies: Object[];
|
|
121
|
+
runtimeRefs: Set<string>;
|
|
122
|
+
};
|
|
123
|
+
/**
|
|
124
|
+
* Tag a PHP file component with its build facts and link it to the runtime
|
|
125
|
+
* component of its version, creating that component on first use. Mutates the
|
|
126
|
+
* component in place, as the Go collector does.
|
|
127
|
+
*
|
|
128
|
+
* @param {{runtimeComponents: Object[], dependencies: Object[], runtimeRefs: Set<string>}} inventory
|
|
129
|
+
* accumulator from createPhpRuntimeInventory
|
|
130
|
+
* @param {Object} component file component, with a `properties` array
|
|
131
|
+
* @param {{version: string, source: string}} build result of readPhpBuildVersion
|
|
132
|
+
* @param {string} sapi result of classifyPhpSapi
|
|
133
|
+
*/
|
|
134
|
+
export declare function attachPhpBuild(inventory: {
|
|
135
|
+
runtimeComponents: Object[];
|
|
136
|
+
dependencies: Object[];
|
|
137
|
+
runtimeRefs: Set<string>;
|
|
138
|
+
}, component: Object, build: {
|
|
139
|
+
version: string;
|
|
140
|
+
source: string;
|
|
141
|
+
}, sapi: string): void;
|
|
142
|
+
//# sourceMappingURL=phpBuildInfo.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"phpBuildInfo.d.ts","sourceRoot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,EAAE,MAAM,CAAA;CAIH,EAAE,IAAI,EAHnC,MAGmC,GAFjC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAC,EAAE,CAQ3C;AAED;;;;GAIG;AACH,wBAAgB,yBAAyB,IAF5B;IAAC,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAAC,YAAY,EAAE,MAAM,EAAE,CAAC;IAAC,WAAW,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;CAAC,CAI3F;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,cAAc,CAAC,SAAS,EAN7B;IAAC,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAAC,YAAY,EAAE,MAAM,EAAE,CAAC;IAAC,WAAW,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;CAMjD,EAAE,SAAS,EAJxC,MAIwC,EAAE,KAAK,EAH/C;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAGe,EAAE,IAAI,EAFrD,MAEqD,QAe/D"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Look for PHP no package manager owns, in the fixed directories of the host.
|
|
3
|
+
* Components come back only for the files nothing owns: a `file` component for
|
|
4
|
+
* each PHP binary or library with the cdx:php properties, one `platform`
|
|
5
|
+
* component per version with its CPE, and the edges between them.
|
|
6
|
+
*
|
|
7
|
+
* @param {Object} [options] probe options
|
|
8
|
+
* @param {string} [options.rootPath] directory the fixed directories hang off:
|
|
9
|
+
* `/`, or the system drive on Windows. Tests point it at a built tree.
|
|
10
|
+
* @param {string} [options.platform] `linux`, `darwin` or `win32`
|
|
11
|
+
* @param {Object} [options.env] environment read for ProgramFiles, SystemDrive
|
|
12
|
+
* and ChocolateyInstall, instead of the process's
|
|
13
|
+
* @param {{dpkgInfoDirectory?: string, apkInstalledFile?: string, rpmDatabaseDirectories?: string[]}} [options.packageDatabases]
|
|
14
|
+
* where the package databases are, instead of under `rootPath`
|
|
15
|
+
* @param {function(string): (Object[]|undefined)} [options.executeOsQuery] runs
|
|
16
|
+
* an osquery query; the rpm database is only asked through it
|
|
17
|
+
* @param {Object[]} [options.packageComponents] the packages the OS scan has
|
|
18
|
+
* inventoried, from which Chocolatey's are known
|
|
19
|
+
* @param {number} [options.maxProbes] most candidate files to look at
|
|
20
|
+
* @returns {{components: Object[], dependencies: Object[]}}
|
|
21
|
+
*/
|
|
22
|
+
export declare function probeHostPhp(options?: {
|
|
23
|
+
rootPath?: string;
|
|
24
|
+
platform?: string;
|
|
25
|
+
env?: Object;
|
|
26
|
+
packageDatabases?: {
|
|
27
|
+
dpkgInfoDirectory?: string;
|
|
28
|
+
apkInstalledFile?: string;
|
|
29
|
+
rpmDatabaseDirectories?: string[];
|
|
30
|
+
};
|
|
31
|
+
}): {
|
|
32
|
+
components: Object[];
|
|
33
|
+
dependencies: Object[];
|
|
34
|
+
};
|
|
35
|
+
//# sourceMappingURL=phpHostProbe.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"phpHostProbe.d.ts","sourceRoot":"","sources":["../../../lib/inventory/phpHostProbe.js"],"names":[],"mappings":"AAmjBA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,YAAY,CAAC,OAAO,AAfjC,CAQA,EAPA;IAAyB,QAAQ,AAAjC,CAEA,EAFQ,MAAM,CAEd;IAAyB,QAAQ,AAAjC,CACA,EADQ,MAAM,CACd;IAAyB,GAAG,AAA5B,CAEA,EAFQ,MAAM,CAEd;IAA6G,gBAAgB,AAA7H,CAEA,EAFQ;QAAC,iBAAiB,CAAC,EAAE,MAAM,CAAC;QAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;QAAC,sBAAsB,CAAC,EAAE,MAAM,EAAE,CAAA;KAAC,CAElG;CAOsC,GAF5B;IAAC,UAAU,EAAE,MAAM,EAAE,CAAC;IAAC,YAAY,EAAE,MAAM,EAAE,CAAA;CAAC,CA0D1D"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export declare const ROOTFS_CERT_LIMITS: Readonly<{
|
|
2
|
+
maxFileBytes: number;
|
|
3
|
+
maxFiles: 20000;
|
|
4
|
+
maxEntries: 500000;
|
|
5
|
+
maxDepth: 12;
|
|
6
|
+
}>;
|
|
7
|
+
/**
|
|
8
|
+
* Pure-JS inventory of the certificate locations trustinspector's rootfs
|
|
9
|
+
* mode covers, plus Kubernetes TLS secrets and Android pins. Used when the
|
|
10
|
+
* plugin is not available. Produces components through the shared
|
|
11
|
+
* CertificateCollector, so bom-refs, names and deduplication match the other
|
|
12
|
+
* producers; locations are root-relative ("/etc/ssl/certs/x.crt").
|
|
13
|
+
*
|
|
14
|
+
* Every access stays inside the root: symlinks (files or directories) are
|
|
15
|
+
* skipped, only regular files are opened, and the walk is bounded by entry,
|
|
16
|
+
* file, size and depth limits.
|
|
17
|
+
*
|
|
18
|
+
* @param {string} rootDir extracted root filesystem
|
|
19
|
+
* @param {object} [limits] overrides for ROOTFS_CERT_LIMITS (tests)
|
|
20
|
+
* @returns {{components: object[], dependencies: object[], warnings: string[]}}
|
|
21
|
+
*/
|
|
22
|
+
export declare function collectRootfsCertificates(rootDir: string, limits?: object): {
|
|
23
|
+
components: object[];
|
|
24
|
+
dependencies: object[];
|
|
25
|
+
warnings: string[];
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=rootfsCerts.d.ts.map
|
|
@@ -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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rustFormulationParser.d.ts","sourceRoot":"","sources":["../../../lib/inventory/rustFormulationParser.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"rustFormulationParser.d.ts","sourceRoot":"","sources":["../../../lib/inventory/rustFormulationParser.js"],"names":[],"mappings":"AAkTA;;;;;;;;GAQG;AACH,eAAO,MAAM,qBAAqB,EAFxB;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,EAAE,CAAC;IAAC,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG;QAAC,UAAU,EAAE,MAAM,EAAE,CAAA;KAAC,CAAA;CAwBxF,CAAC"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Parse a Scala-published Maven artifact name into its coordinate parts.
|
|
3
|
+
*
|
|
4
|
+
* @param {string} name Maven artifactId, for example `upickle_sjs1_3`
|
|
5
|
+
* @returns {{ originalName: string, artifactBase: string, binaryVersion: string|null,
|
|
6
|
+
* platformSuffix: string, purlName: string }} The artifact name without any
|
|
7
|
+
* Scala suffix (`upickle`), the Scala binary version from the suffix (`3`),
|
|
8
|
+
* the platform suffix including the underscore (`_sjs1`) or an empty string,
|
|
9
|
+
* and the artifact name sbt-style purls emit (binary suffix dropped, platform
|
|
10
|
+
* suffix kept).
|
|
11
|
+
*/
|
|
12
|
+
export declare function parseScalaArtifact(name: string): {
|
|
13
|
+
originalName: string;
|
|
14
|
+
artifactBase: string;
|
|
15
|
+
binaryVersion: string | null;
|
|
16
|
+
platformSuffix: string;
|
|
17
|
+
purlName: string;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Build a qualifier-free coordinate key for a Scala-published artifact.
|
|
21
|
+
*
|
|
22
|
+
* The key ignores purl qualifiers such as `repository_url` and `type`, so the
|
|
23
|
+
* POM-coordinate keys of the jar namespace mapping and the sbt-style purls of
|
|
24
|
+
* the components resolve to the same entry.
|
|
25
|
+
*
|
|
26
|
+
* @param {Object} parts Coordinate parts
|
|
27
|
+
* @param {string} [parts.type] Purl type, defaults to `maven`
|
|
28
|
+
* @param {string} [parts.group] Maven groupId
|
|
29
|
+
* @param {string} parts.artifactBase Artifact name without any Scala suffix
|
|
30
|
+
* @param {string} [parts.platformSuffix] `_sjs1`, `_native0.5` or empty
|
|
31
|
+
* @param {string} [parts.version] Package version
|
|
32
|
+
* @returns {string} The coordinate key
|
|
33
|
+
*/
|
|
34
|
+
export declare function scalaCoordinateKey({ type, group, artifactBase, platformSuffix, version, }?: {
|
|
35
|
+
type?: string;
|
|
36
|
+
group?: string;
|
|
37
|
+
artifactBase: string;
|
|
38
|
+
platformSuffix?: string;
|
|
39
|
+
version?: string;
|
|
40
|
+
}): string;
|
|
41
|
+
/**
|
|
42
|
+
* Build the qualifier-free coordinate key of a purl string.
|
|
43
|
+
*
|
|
44
|
+
* The artifact name is normalized with {@link parseScalaArtifact}, so
|
|
45
|
+
* `pkg:maven/g/foo_3@1.0` and the sbt-style `pkg:maven/g/foo@1.0` share a key,
|
|
46
|
+
* while the Scala.js build `foo_sjs1_3` keeps its own key (`foo` plus the
|
|
47
|
+
* `_sjs1` platform suffix) and never joins the plain `foo` component.
|
|
48
|
+
*
|
|
49
|
+
* @param {string} purlString Package URL to normalize
|
|
50
|
+
* @returns {string|undefined} The coordinate key, or undefined when the string
|
|
51
|
+
* is not a parseable purl
|
|
52
|
+
*/
|
|
53
|
+
export declare function coordinateKeyFromPurl(purlString: string): string | undefined;
|
|
54
|
+
/**
|
|
55
|
+
* The coordinate key of a purl together with the Scala binary version its
|
|
56
|
+
* artifact name carries, if any.
|
|
57
|
+
*
|
|
58
|
+
* @param {string} purlString Package URL to normalize
|
|
59
|
+
* @returns {{ key: string, binaryVersion: string|null }|undefined} The key
|
|
60
|
+
* and binary version, or undefined when the string is not a parseable purl
|
|
61
|
+
*/
|
|
62
|
+
export declare function scalaCoordinateOfPurl(purlString: string): {
|
|
63
|
+
key: string;
|
|
64
|
+
binaryVersion: string | null;
|
|
65
|
+
} | undefined;
|
|
66
|
+
/**
|
|
67
|
+
* The artifactId the library is published under, for cache and repository
|
|
68
|
+
* lookups only. Components a Scala build tool reports carry the name with the
|
|
69
|
+
* Scala binary suffix stripped (the platform suffix kept) together with
|
|
70
|
+
* `cdx:scala:compilerVersion`; on disk and in the repository the artifact is
|
|
71
|
+
* `cats-core_2.13` or `upickle_sjs1_3`. Names that end in a full Scala version
|
|
72
|
+
* are used as they are.
|
|
73
|
+
*
|
|
74
|
+
* The component's own `name`, `purl` and `bom-ref` never change.
|
|
75
|
+
*
|
|
76
|
+
* @param {Object} pkg Package with `name` and `properties`.
|
|
77
|
+
* @returns {string} The artifactId to look up.
|
|
78
|
+
*/
|
|
79
|
+
export declare function publishedArtifactId(pkg: Object): string;
|
|
80
|
+
//# sourceMappingURL=scalaCoords.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scalaCoords.d.ts","sourceRoot":"","sources":["../../../lib/inventory/scalaCoords.js"],"names":[],"mappings":"AAWA;;;;;;;;;;GAUG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAR5B,MAQ4B,GAP1B;IAAE,YAAY,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAC;IAAC,aAAa,EAAE,MAAM,GAAC,IAAI,CAAC;IACjF,cAAc,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CA+B9C;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,kBAAkB,CAAC,EACjC,IAAc,EACd,KAAU,EACV,YAAiB,EACjB,cAAmB,EACnB,OAAY,GACb,GAbE;IAAuB,IAAI,AAA3B,CACA,EADQ,MAAM,CACd;IAAuB,KAAK,AAA5B,CACA,EADQ,MAAM,CACd;IAAsB,YAAY,EAA1B,MAAM,CACd;IAAuB,cAAc,AAArC,CACA,EADQ,MAAM,CACd;IAAuB,OAAO,AAA9B,CACA,EADQ,MAAM,CACd;CAQG,GARO,MAAM,CAUlB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,qBAAqB,CAAC,UAAU,EAJrC,MAIqC,GAHnC,MAAM,GAAC,SAAS,CAK5B;AAED;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CAAC,UAAU,EAJrC,MAIqC,GAHnC;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,aAAa,EAAE,MAAM,GAAC,IAAI,CAAA;CAAE,GAAC,SAAS,CA2BjE;AAQD;;;;;;;;;;;;GAYG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAH5B,MAG4B,GAF1B,MAAM,CAWlB"}
|