@cdxgen/cdxgen 13.5.0 → 13.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -10
- package/bin/audit.js +7 -4
- package/bin/cdxgen.js +260 -37
- package/bin/convert.js +146 -22
- package/bin/evinse.js +28 -3
- package/bin/repl.js +47 -3
- package/bin/sign.js +211 -34
- package/bin/tracebom.js +18 -6
- package/bin/validate.js +24 -3
- package/bin/verify.js +113 -5
- package/data/behavior-taxonomy.schema.json +1491 -0
- package/data/cyclonedx-2.0-bundled.schema.json +18606 -5528
- package/data/cyclonedx-2.0-cryptography-defs.schema.json +857 -0
- package/data/license-aliases.json +24 -2
- package/data/pqc-migration.json +239 -0
- package/data/remediations.json +176 -0
- package/data/rules/ai-bom.yaml +1 -1
- package/data/rules/brotli-decoder.yaml +107 -0
- package/data/rules/cbom-security.yaml +4 -3
- package/data/rules/package-integrity.yaml +28 -0
- package/data/rules/vscode-extensions.yaml +75 -0
- package/data/spdx-license-list.json +121 -7
- package/data/spdx-licenses.json +69 -0
- package/data/spdx.schema.json +845 -2
- package/lib/audit/index.js +25 -3
- package/lib/cli/bomAssembly.js +172 -4
- package/lib/cli/cliOptions.js +121 -17
- package/lib/cli/index.js +720 -902
- package/lib/cli/jsBom.js +156 -64
- package/lib/cli/jvmBom.js +602 -86
- package/lib/cli/managedBom.js +161 -19
- package/lib/cli/nativeBom.js +52 -5
- package/lib/core/boundedFile.js +344 -0
- package/lib/core/brotliProbe.js +182 -0
- package/lib/core/env.js +34 -0
- package/lib/core/fs.js +138 -3
- package/lib/core/globPatterns.js +218 -0
- package/lib/core/httpClient.js +98 -1
- package/lib/core/lockPaths.js +38 -0
- package/lib/core/paths.js +24 -1
- package/lib/core/processTree.js +100 -8
- package/lib/core/projectConfig.js +332 -25
- package/lib/core/toolRegistry.js +184 -0
- package/lib/ecosystems/cppEvidence.js +263 -106
- package/lib/ecosystems/cppIncludeResolver.js +16 -5
- package/lib/ecosystems/denoutils.js +2 -2
- package/lib/ecosystems/ecosystems.js +25 -10
- package/lib/ecosystems/gemHostProbe.js +301 -0
- package/lib/ecosystems/golem.js +3 -8
- package/lib/ecosystems/gradleutils.js +1909 -229
- package/lib/ecosystems/jsEvidence.js +90 -38
- package/lib/ecosystems/kosi.js +3 -5
- package/lib/ecosystems/npmVersionResolution.js +376 -0
- package/lib/ecosystems/parsers-bazel.js +107 -6
- package/lib/ecosystems/parsers-js.js +505 -22
- package/lib/ecosystems/parsers-misc.js +209 -20
- package/lib/ecosystems/parsers-python.js +178 -30
- package/lib/ecosystems/parsers-rust.js +117 -15
- package/lib/ecosystems/pythonutils.js +128 -2
- package/lib/ecosystems/remote/huggingface.js +22 -0
- package/lib/ecosystems/rubyutils.js +538 -31
- package/lib/ecosystems/rusi.js +2 -4
- package/lib/ecosystems/scalacliutils.js +2 -0
- package/lib/ecosystems/scalasem.js +798 -152
- package/lib/ecosystems/vendoredCode.js +237 -3
- package/lib/ecosystems/venvProbe.js +360 -0
- package/lib/evinser/evinser.js +536 -71
- package/lib/evinser/scalasem.js +5 -1
- package/lib/helpers/agenticToolutils.js +525 -94
- package/lib/helpers/bomSigner.js +43 -9
- package/lib/helpers/jssSigner.js +1276 -0
- package/lib/helpers/vsixutils.js +1574 -315
- package/lib/inventory/agentBlueprint.js +193 -0
- package/lib/inventory/agentToolNames.js +145 -0
- package/lib/inventory/aiCollector.js +153 -7
- package/lib/inventory/aiInventory.js +44 -8
- package/lib/inventory/aiProviders.js +324 -0
- package/lib/inventory/atomUtils.js +77 -0
- package/lib/inventory/bomUtils.js +8 -1
- package/lib/inventory/brotliDecoder.js +142 -0
- package/lib/inventory/buildToolRateLimit.js +1 -1
- package/lib/inventory/cbomutils.js +56 -7
- package/lib/inventory/ciParsers/githubActionsLock.js +821 -0
- package/lib/inventory/citations.js +31 -2
- package/lib/inventory/communityAiConfigParser.js +978 -80
- package/lib/inventory/cyclonedx20.js +152 -0
- package/lib/inventory/cyclonedx20Common.js +286 -0
- package/lib/inventory/cyclonedx20Derived.js +159 -0
- package/lib/inventory/cyclonedx20Parties.js +552 -0
- package/lib/inventory/cyclonedx20Read.js +768 -0
- package/lib/inventory/cyclonedx20ReadCommon.js +374 -0
- package/lib/inventory/cyclonedx20ReadComponents.js +692 -0
- package/lib/inventory/cyclonedx20ReadContext.js +380 -0
- package/lib/inventory/cyclonedx20ReadEvidence.js +466 -0
- package/lib/inventory/cyclonedx20ReadSections.js +599 -0
- package/lib/inventory/cyclonedx20Render.js +766 -0
- package/lib/inventory/cyclonedx20RenderComponents.js +716 -0
- package/lib/inventory/cyclonedx20RenderDefinitions.js +405 -0
- package/lib/inventory/cyclonedx20RenderEvidence.js +726 -0
- package/lib/inventory/cyclonedx20RenderHardware.js +203 -0
- package/lib/inventory/cyclonedx20RenderPatents.js +174 -0
- package/lib/inventory/cyclonedx20RenderRefIds.js +314 -0
- package/lib/inventory/cyclonedx20RenderSections.js +499 -0
- package/lib/inventory/cyclonedx20Tables.js +594 -0
- package/lib/inventory/deps.js +141 -13
- package/lib/inventory/dosai.js +375 -6
- package/lib/inventory/dosaiParsers.js +3 -6
- package/lib/inventory/dotnetRuntime.js +367 -0
- package/lib/inventory/ecosystemFormulationParsers.js +979 -0
- package/lib/inventory/envcontext.js +436 -48
- package/lib/inventory/evidenceUtils.js +13 -1
- package/lib/inventory/fetchBatch.js +1 -1
- package/lib/inventory/formulationParsers.js +124 -14
- package/lib/inventory/gtfobins.js +13 -0
- package/lib/inventory/hbom.js +45 -6
- package/lib/inventory/hbomLoader.js +166 -0
- package/lib/inventory/hostRuntimeProbe.js +686 -0
- package/lib/inventory/jvmLocalRepos.js +9 -2
- package/lib/inventory/jvmToolEnv.js +29 -0
- package/lib/inventory/licenseEnhancer.js +12 -0
- package/lib/inventory/mavenCentralMirror.js +534 -0
- package/lib/inventory/mcpConfigParser.js +5 -0
- package/lib/inventory/nodeBuildInfo.js +218 -0
- package/lib/inventory/nodeHostProbe.js +202 -0
- package/lib/inventory/occurrenceKey.js +90 -0
- package/lib/inventory/osPackageResolver.js +182 -0
- package/lib/inventory/phpBuildInfo.js +10 -59
- package/lib/inventory/phpHostProbe.js +32 -488
- package/lib/inventory/pqcMigration.js +426 -0
- package/lib/inventory/rubyBuildInfo.js +972 -0
- package/lib/inventory/rubyHostProbe.js +218 -0
- package/lib/inventory/rustFormulationParser.js +21 -10
- package/lib/inventory/scalaCoords.js +4 -3
- package/lib/inventory/scalaDedupe.js +440 -0
- package/lib/inventory/source.js +114 -8
- package/lib/managers/binary.js +337 -3
- package/lib/managers/docker.js +79 -0
- package/lib/parsers/huggingfaceManifest.js +9 -1
- package/lib/parsers/huggingfaceUtils.js +18 -0
- package/lib/parsers/kiroPermissions.js +166 -0
- package/lib/parsers/largeJson.js +28 -11
- package/lib/parsers/vscodeExtensionId.js +183 -0
- package/lib/server/server.js +48 -35
- package/lib/stages/postgen/postgen.js +41 -1
- package/lib/stages/postgen/ruleEngine.js +13 -5
- package/lib/stages/postgen/specVersionCompat.js +76 -0
- package/lib/stages/pregen/envAudit.js +1 -0
- package/lib/stages/pregen/pregen.js +114 -57
- package/lib/validator/bomValidator.js +14 -2
- package/lib/validator/complianceEngine.js +30 -3
- package/lib/validator/complianceRules.js +1416 -4
- package/lib/validator/generated/validate-1.6.mjs +1 -1
- package/lib/validator/generated/validate-1.7.mjs +1 -1
- package/lib/validator/generated/validate-2.0.mjs +57554 -13851
- package/lib/validator/index.js +49 -8
- package/lib/validator/reporters/json.js +6 -0
- package/package.json +11 -10
- package/types/bin/repl.d.ts.map +1 -1
- package/types/lib/audit/index.d.ts +6 -2
- package/types/lib/audit/index.d.ts.map +1 -1
- package/types/lib/cli/bomAssembly.d.ts +29 -1
- package/types/lib/cli/bomAssembly.d.ts.map +1 -1
- package/types/lib/cli/cliOptions.d.ts +6 -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 +3 -18
- package/types/lib/cli/jsBom.d.ts.map +1 -1
- package/types/lib/cli/jvmBom.d.ts +15 -0
- package/types/lib/cli/jvmBom.d.ts.map +1 -1
- package/types/lib/cli/managedBom.d.ts.map +1 -1
- package/types/lib/cli/nativeBom.d.ts.map +1 -1
- package/types/lib/core/boundedFile.d.ts +100 -0
- package/types/lib/core/boundedFile.d.ts.map +1 -0
- package/types/lib/core/brotliProbe.d.ts +37 -0
- package/types/lib/core/brotliProbe.d.ts.map +1 -0
- package/types/lib/core/env.d.ts +14 -0
- package/types/lib/core/env.d.ts.map +1 -1
- package/types/lib/core/fs.d.ts +4 -0
- package/types/lib/core/fs.d.ts.map +1 -1
- package/types/lib/core/globPatterns.d.ts +70 -0
- package/types/lib/core/globPatterns.d.ts.map +1 -0
- package/types/lib/core/httpClient.d.ts +24 -0
- package/types/lib/core/httpClient.d.ts.map +1 -1
- package/types/lib/core/lockPaths.d.ts +19 -0
- package/types/lib/core/lockPaths.d.ts.map +1 -0
- package/types/lib/core/paths.d.ts +9 -0
- package/types/lib/core/paths.d.ts.map +1 -1
- package/types/lib/core/processTree.d.ts +17 -4
- package/types/lib/core/processTree.d.ts.map +1 -1
- package/types/lib/core/projectConfig.d.ts +47 -8
- package/types/lib/core/projectConfig.d.ts.map +1 -1
- package/types/lib/core/toolRegistry.d.ts +36 -0
- package/types/lib/core/toolRegistry.d.ts.map +1 -0
- package/types/lib/ecosystems/cppEvidence.d.ts +40 -13
- package/types/lib/ecosystems/cppEvidence.d.ts.map +1 -1
- package/types/lib/ecosystems/cppIncludeResolver.d.ts +2 -1
- package/types/lib/ecosystems/cppIncludeResolver.d.ts.map +1 -1
- package/types/lib/ecosystems/ecosystems.d.ts.map +1 -1
- package/types/lib/ecosystems/gemHostProbe.d.ts +28 -0
- package/types/lib/ecosystems/gemHostProbe.d.ts.map +1 -0
- package/types/lib/ecosystems/golem.d.ts.map +1 -1
- package/types/lib/ecosystems/gradleutils.d.ts +294 -20
- package/types/lib/ecosystems/gradleutils.d.ts.map +1 -1
- package/types/lib/ecosystems/jsEvidence.d.ts +14 -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/npmVersionResolution.d.ts +119 -0
- package/types/lib/ecosystems/npmVersionResolution.d.ts.map +1 -0
- package/types/lib/ecosystems/parsers-bazel.d.ts.map +1 -1
- package/types/lib/ecosystems/parsers-js.d.ts +17 -20
- package/types/lib/ecosystems/parsers-js.d.ts.map +1 -1
- package/types/lib/ecosystems/parsers-misc.d.ts +19 -0
- package/types/lib/ecosystems/parsers-misc.d.ts.map +1 -1
- package/types/lib/ecosystems/parsers-python.d.ts +10 -0
- package/types/lib/ecosystems/parsers-python.d.ts.map +1 -1
- package/types/lib/ecosystems/parsers-rust.d.ts.map +1 -1
- package/types/lib/ecosystems/pythonutils.d.ts +19 -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 +144 -12
- package/types/lib/ecosystems/rubyutils.d.ts.map +1 -1
- package/types/lib/ecosystems/rusi.d.ts.map +1 -1
- package/types/lib/ecosystems/scalacliutils.d.ts.map +1 -1
- package/types/lib/ecosystems/scalasem.d.ts +58 -16
- package/types/lib/ecosystems/scalasem.d.ts.map +1 -1
- package/types/lib/ecosystems/vendoredCode.d.ts +26 -0
- package/types/lib/ecosystems/vendoredCode.d.ts.map +1 -1
- package/types/lib/ecosystems/venvProbe.d.ts +40 -0
- package/types/lib/ecosystems/venvProbe.d.ts.map +1 -0
- package/types/lib/evinser/evinser.d.ts +120 -13
- package/types/lib/evinser/evinser.d.ts.map +1 -1
- package/types/lib/evinser/scalasem.d.ts.map +1 -1
- package/types/lib/helpers/agenticToolutils.d.ts +53 -19
- package/types/lib/helpers/agenticToolutils.d.ts.map +1 -1
- package/types/lib/helpers/bomSigner.d.ts +20 -3
- package/types/lib/helpers/bomSigner.d.ts.map +1 -1
- package/types/lib/helpers/jssSigner.d.ts +288 -0
- package/types/lib/helpers/jssSigner.d.ts.map +1 -0
- package/types/lib/helpers/vsixutils.d.ts +303 -19
- package/types/lib/helpers/vsixutils.d.ts.map +1 -1
- package/types/lib/inventory/agentBlueprint.d.ts +70 -0
- package/types/lib/inventory/agentBlueprint.d.ts.map +1 -0
- package/types/lib/inventory/agentToolNames.d.ts +51 -0
- package/types/lib/inventory/agentToolNames.d.ts.map +1 -0
- package/types/lib/inventory/aiCollector.d.ts.map +1 -1
- package/types/lib/inventory/aiInventory.d.ts.map +1 -1
- package/types/lib/inventory/aiProviders.d.ts +85 -0
- package/types/lib/inventory/aiProviders.d.ts.map +1 -0
- package/types/lib/inventory/atomUtils.d.ts +19 -0
- package/types/lib/inventory/atomUtils.d.ts.map +1 -1
- package/types/lib/inventory/bomUtils.d.ts.map +1 -1
- package/types/lib/inventory/brotliDecoder.d.ts +58 -0
- package/types/lib/inventory/brotliDecoder.d.ts.map +1 -0
- package/types/lib/inventory/cbomutils.d.ts +17 -0
- package/types/lib/inventory/cbomutils.d.ts.map +1 -1
- package/types/lib/inventory/ciParsers/githubActionsLock.d.ts +101 -0
- package/types/lib/inventory/ciParsers/githubActionsLock.d.ts.map +1 -0
- package/types/lib/inventory/citations.d.ts +5 -0
- package/types/lib/inventory/citations.d.ts.map +1 -1
- package/types/lib/inventory/communityAiConfigParser.d.ts.map +1 -1
- package/types/lib/inventory/cyclonedx20.d.ts +99 -0
- package/types/lib/inventory/cyclonedx20.d.ts.map +1 -0
- package/types/lib/inventory/cyclonedx20Common.d.ts +102 -0
- package/types/lib/inventory/cyclonedx20Common.d.ts.map +1 -0
- package/types/lib/inventory/cyclonedx20Derived.d.ts +74 -0
- package/types/lib/inventory/cyclonedx20Derived.d.ts.map +1 -0
- package/types/lib/inventory/cyclonedx20Parties.d.ts +91 -0
- package/types/lib/inventory/cyclonedx20Parties.d.ts.map +1 -0
- package/types/lib/inventory/cyclonedx20Read.d.ts +51 -0
- package/types/lib/inventory/cyclonedx20Read.d.ts.map +1 -0
- package/types/lib/inventory/cyclonedx20ReadCommon.d.ts +69 -0
- package/types/lib/inventory/cyclonedx20ReadCommon.d.ts.map +1 -0
- package/types/lib/inventory/cyclonedx20ReadComponents.d.ts +77 -0
- package/types/lib/inventory/cyclonedx20ReadComponents.d.ts.map +1 -0
- package/types/lib/inventory/cyclonedx20ReadContext.d.ts +118 -0
- package/types/lib/inventory/cyclonedx20ReadContext.d.ts.map +1 -0
- package/types/lib/inventory/cyclonedx20ReadEvidence.d.ts +40 -0
- package/types/lib/inventory/cyclonedx20ReadEvidence.d.ts.map +1 -0
- package/types/lib/inventory/cyclonedx20ReadSections.d.ts +45 -0
- package/types/lib/inventory/cyclonedx20ReadSections.d.ts.map +1 -0
- package/types/lib/inventory/cyclonedx20Render.d.ts +53 -0
- package/types/lib/inventory/cyclonedx20Render.d.ts.map +1 -0
- package/types/lib/inventory/cyclonedx20RenderComponents.d.ts +73 -0
- package/types/lib/inventory/cyclonedx20RenderComponents.d.ts.map +1 -0
- package/types/lib/inventory/cyclonedx20RenderDefinitions.d.ts +29 -0
- package/types/lib/inventory/cyclonedx20RenderDefinitions.d.ts.map +1 -0
- package/types/lib/inventory/cyclonedx20RenderEvidence.d.ts +110 -0
- package/types/lib/inventory/cyclonedx20RenderEvidence.d.ts.map +1 -0
- package/types/lib/inventory/cyclonedx20RenderHardware.d.ts +42 -0
- package/types/lib/inventory/cyclonedx20RenderHardware.d.ts.map +1 -0
- package/types/lib/inventory/cyclonedx20RenderPatents.d.ts +26 -0
- package/types/lib/inventory/cyclonedx20RenderPatents.d.ts.map +1 -0
- package/types/lib/inventory/cyclonedx20RenderRefIds.d.ts +55 -0
- package/types/lib/inventory/cyclonedx20RenderRefIds.d.ts.map +1 -0
- package/types/lib/inventory/cyclonedx20RenderSections.d.ts +45 -0
- package/types/lib/inventory/cyclonedx20RenderSections.d.ts.map +1 -0
- package/types/lib/inventory/cyclonedx20Tables.d.ts +134 -0
- package/types/lib/inventory/cyclonedx20Tables.d.ts.map +1 -0
- package/types/lib/inventory/deps.d.ts +35 -2
- package/types/lib/inventory/deps.d.ts.map +1 -1
- package/types/lib/inventory/dosai.d.ts +36 -1
- package/types/lib/inventory/dosai.d.ts.map +1 -1
- package/types/lib/inventory/dosaiParsers.d.ts.map +1 -1
- package/types/lib/inventory/dotnetRuntime.d.ts +91 -0
- package/types/lib/inventory/dotnetRuntime.d.ts.map +1 -0
- package/types/lib/inventory/ecosystemFormulationParsers.d.ts +73 -0
- package/types/lib/inventory/ecosystemFormulationParsers.d.ts.map +1 -0
- package/types/lib/inventory/envcontext.d.ts +74 -12
- package/types/lib/inventory/envcontext.d.ts.map +1 -1
- package/types/lib/inventory/evidenceUtils.d.ts.map +1 -1
- package/types/lib/inventory/formulationParsers.d.ts.map +1 -1
- package/types/lib/inventory/gtfobins.d.ts.map +1 -1
- package/types/lib/inventory/hbom.d.ts +11 -0
- package/types/lib/inventory/hbom.d.ts.map +1 -1
- package/types/lib/inventory/hbomLoader.d.ts +54 -0
- package/types/lib/inventory/hbomLoader.d.ts.map +1 -1
- package/types/lib/inventory/hostRuntimeProbe.d.ts +44 -0
- package/types/lib/inventory/hostRuntimeProbe.d.ts.map +1 -0
- package/types/lib/inventory/jvmLocalRepos.d.ts +5 -1
- package/types/lib/inventory/jvmLocalRepos.d.ts.map +1 -1
- package/types/lib/inventory/jvmToolEnv.d.ts +12 -0
- package/types/lib/inventory/jvmToolEnv.d.ts.map +1 -1
- package/types/lib/inventory/licenseEnhancer.d.ts.map +1 -1
- package/types/lib/inventory/mavenCentralMirror.d.ts +170 -0
- package/types/lib/inventory/mavenCentralMirror.d.ts.map +1 -0
- package/types/lib/inventory/mcpConfigParser.d.ts.map +1 -1
- package/types/lib/inventory/nodeBuildInfo.d.ts +95 -0
- package/types/lib/inventory/nodeBuildInfo.d.ts.map +1 -0
- package/types/lib/inventory/nodeHostProbe.d.ts +15 -0
- package/types/lib/inventory/nodeHostProbe.d.ts.map +1 -0
- package/types/lib/inventory/occurrenceKey.d.ts +52 -0
- package/types/lib/inventory/occurrenceKey.d.ts.map +1 -0
- package/types/lib/inventory/osPackageResolver.d.ts +38 -0
- package/types/lib/inventory/osPackageResolver.d.ts.map +1 -1
- package/types/lib/inventory/phpBuildInfo.d.ts.map +1 -1
- package/types/lib/inventory/phpHostProbe.d.ts.map +1 -1
- package/types/lib/inventory/pqcMigration.d.ts +84 -0
- package/types/lib/inventory/pqcMigration.d.ts.map +1 -0
- package/types/lib/inventory/rubyBuildInfo.d.ts +271 -0
- package/types/lib/inventory/rubyBuildInfo.d.ts.map +1 -0
- package/types/lib/inventory/rubyHostProbe.d.ts +47 -0
- package/types/lib/inventory/rubyHostProbe.d.ts.map +1 -0
- package/types/lib/inventory/rustFormulationParser.d.ts +7 -2
- package/types/lib/inventory/rustFormulationParser.d.ts.map +1 -1
- package/types/lib/inventory/scalaCoords.d.ts.map +1 -1
- package/types/lib/inventory/scalaDedupe.d.ts +43 -0
- package/types/lib/inventory/scalaDedupe.d.ts.map +1 -0
- package/types/lib/inventory/source.d.ts +25 -0
- package/types/lib/inventory/source.d.ts.map +1 -1
- 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/parsers/huggingfaceManifest.d.ts +10 -1
- package/types/lib/parsers/huggingfaceManifest.d.ts.map +1 -1
- package/types/lib/parsers/huggingfaceUtils.d.ts +12 -0
- package/types/lib/parsers/huggingfaceUtils.d.ts.map +1 -1
- package/types/lib/parsers/kiroPermissions.d.ts +62 -0
- package/types/lib/parsers/kiroPermissions.d.ts.map +1 -0
- package/types/lib/parsers/largeJson.d.ts +4 -3
- package/types/lib/parsers/largeJson.d.ts.map +1 -1
- package/types/lib/parsers/vscodeExtensionId.d.ts +48 -0
- package/types/lib/parsers/vscodeExtensionId.d.ts.map +1 -0
- package/types/lib/server/server.d.ts.map +1 -1
- package/types/lib/stages/postgen/postgen.d.ts +7 -0
- package/types/lib/stages/postgen/postgen.d.ts.map +1 -1
- package/types/lib/stages/postgen/ruleEngine.d.ts.map +1 -1
- package/types/lib/stages/postgen/specVersionCompat.d.ts +25 -0
- package/types/lib/stages/postgen/specVersionCompat.d.ts.map +1 -1
- package/types/lib/stages/pregen/envAudit.d.ts.map +1 -1
- package/types/lib/stages/pregen/pregen.d.ts +12 -8
- package/types/lib/stages/pregen/pregen.d.ts.map +1 -1
- package/types/lib/validator/bomValidator.d.ts +5 -1
- package/types/lib/validator/bomValidator.d.ts.map +1 -1
- package/types/lib/validator/complianceEngine.d.ts +4 -4
- package/types/lib/validator/complianceEngine.d.ts.map +1 -1
- package/types/lib/validator/complianceRules.d.ts +14 -2
- package/types/lib/validator/complianceRules.d.ts.map +1 -1
- package/types/lib/validator/index.d.ts +10 -0
- package/types/lib/validator/index.d.ts.map +1 -1
- package/types/lib/validator/reporters/json.d.ts.map +1 -1
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared state and the field-mapping engine of the CycloneDX 2.0 reader.
|
|
3
|
+
*
|
|
4
|
+
* Every 2.0 object kind the reader converts has a frozen field spec: the
|
|
5
|
+
* allowlist of the members the 1.x model carries, with the 1.x name or the
|
|
6
|
+
* converter for each. `reverseFields` walks the object's own members in
|
|
7
|
+
* document order and reports every member the spec does not list as a loss,
|
|
8
|
+
* so a field the reader has no mapping for can never vanish silently.
|
|
9
|
+
*
|
|
10
|
+
* Loss pointers are RFC 6901 JSON pointers into the 2.0 input, with array
|
|
11
|
+
* indexes and `~`/`/` escaped.
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* Mark `bom` as cdxgen's 1.x-shaped internal model. The mark is a
|
|
15
|
+
* non-enumerable symbol property, so it never reaches JSON output, and a
|
|
16
|
+
* copy made with JSON or structuredClone does not carry it.
|
|
17
|
+
*
|
|
18
|
+
* @param {object} bom The internal model
|
|
19
|
+
* @returns {object} The same object
|
|
20
|
+
*/
|
|
21
|
+
export declare function markInternalModel(bom: object): object;
|
|
22
|
+
/**
|
|
23
|
+
* Whether `bom` carries the internal model mark of markInternalModel.
|
|
24
|
+
*
|
|
25
|
+
* @param {object} bom Any value
|
|
26
|
+
* @returns {boolean} True for a marked internal model
|
|
27
|
+
*/
|
|
28
|
+
export declare function isMarkedInternalModel(bom: object): boolean;
|
|
29
|
+
export declare const MAX_READ_DEPTH = 256;
|
|
30
|
+
/**
|
|
31
|
+
* Copy a parsed JSON value, leaving out every object nested deeper than
|
|
32
|
+
* `maxDepth` objects and recording its JSON pointer. Arrays do not count
|
|
33
|
+
* towards the depth, so every object entry of one array sits at the same
|
|
34
|
+
* depth and is cut with the rest; an array left empty by the cut is left out
|
|
35
|
+
* of its parent object too. Iterative, so no input depth can exhaust the
|
|
36
|
+
* call stack.
|
|
37
|
+
*
|
|
38
|
+
* @param {*} value Parsed JSON value
|
|
39
|
+
* @param {number} [maxDepth] Deepest object level kept
|
|
40
|
+
* @returns {{value: *, truncated: string[]}} The copy and the pointers of the
|
|
41
|
+
* objects that were cut
|
|
42
|
+
*/
|
|
43
|
+
export declare function cloneWithDepthLimit(value: any, maxDepth?: number): {
|
|
44
|
+
value: any;
|
|
45
|
+
truncated: string[];
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* A fresh reader context for one 2.0 document.
|
|
49
|
+
*
|
|
50
|
+
* @param {object} doc The (private, cloned) 2.0 document
|
|
51
|
+
* @returns {object} Reader context
|
|
52
|
+
*/
|
|
53
|
+
export declare function createReadContext(doc: object): object;
|
|
54
|
+
/**
|
|
55
|
+
* Append reference tokens to a JSON pointer (RFC 6901): `~` becomes `~0` and
|
|
56
|
+
* `/` becomes `~1`; array indexes are plain numbers.
|
|
57
|
+
*
|
|
58
|
+
* @param {string} base Pointer so far ("" is the whole document)
|
|
59
|
+
* @param {...(string|number)} tokens Member names or array indexes
|
|
60
|
+
* @returns {string} The extended pointer
|
|
61
|
+
*/
|
|
62
|
+
export declare function jsonPointer(base: string, ...tokens: (string | number)[]): string;
|
|
63
|
+
/** Record one loss. */
|
|
64
|
+
export declare function addLoss(ctx: any, pointer: any, reason: any): void;
|
|
65
|
+
/**
|
|
66
|
+
* Report every defined member of `source` that `carried` does not list.
|
|
67
|
+
*
|
|
68
|
+
* @param {object} ctx Reader context
|
|
69
|
+
* @param {string} kind 2.0 object kind, used in the reason
|
|
70
|
+
* @param {object} source 2.0 object
|
|
71
|
+
* @param {string} pointer JSON pointer of `source`
|
|
72
|
+
* @param {Set<string>|object} carried Member names (a Set or spec keys)
|
|
73
|
+
*/
|
|
74
|
+
export declare function reportUnmapped(ctx: object, kind: string, source: object, pointer: string, carried: Set<string> | object): void;
|
|
75
|
+
/**
|
|
76
|
+
* Convert one 2.0 object with a field spec. A spec maps each carried 2.0
|
|
77
|
+
* member to `true` (copied under the same name), a string (copied under that
|
|
78
|
+
* 1.x name) or `{to?, spread?, convert}` where
|
|
79
|
+
* `convert(ctx, value, pointer, source)` returns the 1.x value or undefined
|
|
80
|
+
* (and reports its own losses); a `spread` rule returns an object of 1.x
|
|
81
|
+
* members to merge (one 2.0 member feeding several 1.x fields). Members
|
|
82
|
+
* the spec does not list are reported through reportUnmapped.
|
|
83
|
+
*
|
|
84
|
+
* @param {object} ctx Reader context
|
|
85
|
+
* @param {string} kind 2.0 object kind
|
|
86
|
+
* @param {object} source 2.0 object
|
|
87
|
+
* @param {string} pointer JSON pointer of `source`
|
|
88
|
+
* @param {object} spec Frozen field spec
|
|
89
|
+
* @returns {object} The 1.x object
|
|
90
|
+
*/
|
|
91
|
+
export declare function reverseFields(ctx: object, kind: string, source: object, pointer: string, spec: object): object;
|
|
92
|
+
/**
|
|
93
|
+
* Convert each entry of a 2.0 array with `convertEntry(ctx, entry, pointer)`,
|
|
94
|
+
* dropping entries that convert to undefined. A non-array is a loss.
|
|
95
|
+
*/
|
|
96
|
+
export declare function reverseList(ctx: any, value: any, pointer: any, convertEntry: any): any[] | undefined;
|
|
97
|
+
/** A spec rule converting an array entry by entry. */
|
|
98
|
+
export declare function listOf(convertEntry: any, to: any): Readonly<{
|
|
99
|
+
to: any;
|
|
100
|
+
convert: (ctx: any, value: any, pointer: any) => any[] | undefined;
|
|
101
|
+
}>;
|
|
102
|
+
/** A spec rule converting a nested object with its own spec. */
|
|
103
|
+
export declare function objectOf(kind: any, spec: any, to: any): Readonly<{
|
|
104
|
+
to: any;
|
|
105
|
+
convert: (ctx: any, value: any, pointer: any) => object | undefined;
|
|
106
|
+
}>;
|
|
107
|
+
/** reverseFields for a value that must be an object; a loss otherwise. */
|
|
108
|
+
export declare function reverseObject(ctx: any, kind: any, value: any, pointer: any, spec: any): object | undefined;
|
|
109
|
+
/** Keep `original` for the 1.x value `internal` in namespace `kind`. */
|
|
110
|
+
export declare function registerShadow(ctx: any, kind: any, internal: any, original: any): void;
|
|
111
|
+
/** Keep `original` under a precomputed shadow key. */
|
|
112
|
+
export declare function registerShadowKey(ctx: any, kind: any, key: any, original: any): void;
|
|
113
|
+
/**
|
|
114
|
+
* Run `read()` with component shadows suspended: for section entries that
|
|
115
|
+
* are restored whole, whose nested components the renderer never converts.
|
|
116
|
+
*/
|
|
117
|
+
export declare function withoutComponentShadows(ctx: any, read: any): any;
|
|
118
|
+
//# sourceMappingURL=cyclonedx20ReadContext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cyclonedx20ReadContext.d.ts","sourceRoot":"","sources":["../../../lib/inventory/cyclonedx20ReadContext.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AASH;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAH1B,MAG0B,GAFxB,MAAM,CAUlB;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,EAH9B,MAG8B,GAF5B,OAAO,CAInB;AAKD,eAAO,MAAM,cAAc,MAAM,CAAC;AAElC;;;;;;;;;;;;GAYG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAL9B,GAK8B,EAAE,QAAQ,AAJhD,CACA,EADQ,MAIyD,GAHvD;IAAC,KAAK,EAAE,GAAC,CAAC;IAAC,SAAS,EAAE,MAAM,EAAE,CAAA;CAAC,CAiE3C;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAH1B,MAG0B,GAFxB,MAAM,CAgBlB;AAsED;;;;;;;GAOG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAJrB,MAIqB,EAAE,GAAG,MAAM,EAH7B,CAAC,MAAM,GAAC,MAAM,CAAC,EAGc,GAF9B,MAAM,CAQlB;AAED,uBAAuB;AACvB,wBAAgB,OAAO,CAAC,GAAG,KAAA,EAAE,OAAO,KAAA,EAAE,MAAM,KAAA,QAE3C;AAED;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,GAAG,EANvB,MAMuB,EAAE,IAAI,EAL7B,MAK6B,EAAE,MAAM,EAJrC,MAIqC,EAAE,OAAO,EAH9C,MAG8C,EAAE,OAAO,EAFvD,GAAG,CAAC,MAAM,CAAC,GAAC,MAE2C,QAYjE;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAPtB,MAOsB,EAAE,IAAI,EAN5B,MAM4B,EAAE,MAAM,EALpC,MAKoC,EAAE,OAAO,EAJ7C,MAI6C,EAAE,IAAI,EAHnD,MAGmD,GAFjD,MAAM,CA6BlB;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,GAAG,KAAA,EAAE,KAAK,KAAA,EAAE,OAAO,KAAA,EAAE,YAAY,KAAA,qBAa5D;AAED,sDAAsD;AACtD,wBAAgB,MAAM,CAAC,YAAY,KAAA,EAAE,EAAE,KAAA;;;GAMtC;AAED,gEAAgE;AAChE,wBAAgB,QAAQ,CAAC,IAAI,KAAA,EAAE,IAAI,KAAA,EAAE,EAAE,KAAA;;;GAMtC;AAED,0EAA0E;AAC1E,wBAAgB,aAAa,CAAC,GAAG,KAAA,EAAE,IAAI,KAAA,EAAE,KAAK,KAAA,EAAE,OAAO,KAAA,EAAE,IAAI,KAAA,sBAO5D;AAED,wEAAwE;AACxE,wBAAgB,cAAc,CAAC,GAAG,KAAA,EAAE,IAAI,KAAA,EAAE,QAAQ,KAAA,EAAE,QAAQ,KAAA,QAE3D;AAED,sDAAsD;AACtD,wBAAgB,iBAAiB,CAAC,GAAG,KAAA,EAAE,IAAI,KAAA,EAAE,GAAG,KAAA,EAAE,QAAQ,KAAA,QAGzD;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,GAAG,KAAA,EAAE,IAAI,KAAA,OAQhD"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reader converters for CycloneDX 2.0 component evidence
|
|
3
|
+
* (#/$defs/cyclonedx-component-2.0/$defs/componentEvidence and
|
|
4
|
+
* #/$defs/cyclonedx-evidence-2.0) and cryptoProperties
|
|
5
|
+
* (#/$defs/cyclonedx-cryptography-2.0/$defs/cryptoProperties) back to the 1.x
|
|
6
|
+
* shapes. Each frozen spec is the allowlist of the members 1.x carries.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Register the identity shadows. An identity shadow is looked up by its 1.x
|
|
10
|
+
* projection alone, whichever component carries it, so a key is registered
|
|
11
|
+
* only when every identity entry read under it needs the same original; a
|
|
12
|
+
* key shared with an entry that renders back by itself, or with a different
|
|
13
|
+
* original, is left to the component shadows.
|
|
14
|
+
*
|
|
15
|
+
* @param {object} ctx Reader context
|
|
16
|
+
*/
|
|
17
|
+
export declare function flushIdentityShadows(ctx: object): void;
|
|
18
|
+
/**
|
|
19
|
+
* componentEvidence → 1.x evidence.
|
|
20
|
+
*
|
|
21
|
+
* @param {object} ctx Reader context
|
|
22
|
+
* @param {object} value 2.0 componentEvidence
|
|
23
|
+
* @param {string} pointer JSON pointer of `value`
|
|
24
|
+
* @returns {object|undefined} 1.x evidence
|
|
25
|
+
*/
|
|
26
|
+
export declare function reverseEvidence(ctx: object, value: object, pointer: string): object | undefined;
|
|
27
|
+
/**
|
|
28
|
+
* cryptoProperties → 1.x cryptoProperties: list-valued
|
|
29
|
+
* `implementationPlatform` and `securedBy.algorithmRef` become one value,
|
|
30
|
+
* enum values 1.7 does not list are dropped, and 2.0-only members
|
|
31
|
+
* (`secProperties`, `renewal`, `rotation`, `keyUsage`, non-hash
|
|
32
|
+
* fingerprints) are losses.
|
|
33
|
+
*
|
|
34
|
+
* @param {object} ctx Reader context
|
|
35
|
+
* @param {object} value 2.0 cryptoProperties
|
|
36
|
+
* @param {string} pointer JSON pointer of `value`
|
|
37
|
+
* @returns {object|undefined} 1.x cryptoProperties
|
|
38
|
+
*/
|
|
39
|
+
export declare function reverseCryptoProperties(ctx: object, value: object, pointer: string): object | undefined;
|
|
40
|
+
//# sourceMappingURL=cyclonedx20ReadEvidence.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cyclonedx20ReadEvidence.d.ts","sourceRoot":"","sources":["../../../lib/inventory/cyclonedx20ReadEvidence.js"],"names":[],"mappings":"AAAA;;;;;;GAMG;AA4JH;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAF7B,MAE6B,QAmBvC;AA0GD;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,GAAG,EALxB,MAKwB,EAAE,KAAK,EAJ/B,MAI+B,EAAE,OAAO,EAHxC,MAGwC,GAFtC,MAAM,GAAC,SAAS,CAI5B;AAiJD;;;;;;;;;;;GAWG;AACH,wBAAgB,uBAAuB,CAAC,GAAG,EALhC,MAKgC,EAAE,KAAK,EAJvC,MAIuC,EAAE,OAAO,EAHhD,MAGgD,GAF9C,MAAM,GAAC,SAAS,CAI5B"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reader converters for the CycloneDX 2.0 document sections other than the
|
|
3
|
+
* inventories: metadata, compositions, annotations, vulnerabilities,
|
|
4
|
+
* citations and formulation. Each frozen spec is the allowlist of the
|
|
5
|
+
* members 1.x carries; everything else is a loss. Every converted section
|
|
6
|
+
* entry is kept as a shadow, so a read-then-render round trip restores the
|
|
7
|
+
* 2.0 members the 1.x model has no field for while the entry is unchanged.
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* metadata → 1.x metadata without `component` (the inventory subject) and
|
|
11
|
+
* `tools` (read separately, so each tool component has its own shadow).
|
|
12
|
+
*
|
|
13
|
+
* @param {object} ctx Reader context
|
|
14
|
+
* @param {object} metadata 2.0 metadata
|
|
15
|
+
* @returns {object} 1.x metadata
|
|
16
|
+
*/
|
|
17
|
+
export declare function readMetadata(ctx: object, metadata: object): object;
|
|
18
|
+
/**
|
|
19
|
+
* compositions → 1.x compositions.
|
|
20
|
+
*
|
|
21
|
+
* @param {object} ctx Reader context
|
|
22
|
+
* @param {Array} compositions 2.0 compositions
|
|
23
|
+
* @param {Map<string, string|undefined>} inventorySubjects inventory refId →
|
|
24
|
+
* subject refId
|
|
25
|
+
* @returns {Array|undefined} 1.x compositions
|
|
26
|
+
*/
|
|
27
|
+
export declare function readCompositions(ctx: object, compositions: any[], inventorySubjects: Map<string, string | undefined>): any[] | undefined;
|
|
28
|
+
/** annotations → 1.x annotations. */
|
|
29
|
+
export declare function readAnnotations(ctx: any, annotations: any): any[] | undefined;
|
|
30
|
+
/** vulnerabilities → 1.x vulnerabilities. */
|
|
31
|
+
export declare function readVulnerabilities(ctx: any, vulnerabilities: any): any[] | undefined;
|
|
32
|
+
/** A 2.0 citation JSONPath expression → its 1.x form. */
|
|
33
|
+
export declare function reverseCitationExpression(expression: any): any;
|
|
34
|
+
/** citations → 1.x citations. */
|
|
35
|
+
export declare function readCitations(ctx: any, citations: any): any[] | undefined;
|
|
36
|
+
/**
|
|
37
|
+
* formulation → 1.x formulas without their components (the reader puts the
|
|
38
|
+
* formula components back from definitions afterwards).
|
|
39
|
+
*
|
|
40
|
+
* @param {object} ctx Reader context
|
|
41
|
+
* @param {Array} formulation 2.0 formulation
|
|
42
|
+
* @returns {Array|undefined} 1.x formulas
|
|
43
|
+
*/
|
|
44
|
+
export declare function readFormulation(ctx: object, formulation: any[]): any[] | undefined;
|
|
45
|
+
//# sourceMappingURL=cyclonedx20ReadSections.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cyclonedx20ReadSections.d.ts","sourceRoot":"","sources":["../../../lib/inventory/cyclonedx20ReadSections.js"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AA2EH;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAJrB,MAIqB,EAAE,QAAQ,EAH/B,MAG+B,GAF7B,MAAM,CAsBlB;AAkED;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EANzB,MAMyB,EAAE,YAAY,OAAA,EAAE,iBAAiB,EAJ1D,GAAG,CAAC,MAAM,EAAE,MAAM,GAAC,SAAS,CAI8B,GAFxD,QAAM,SAAS,CAU3B;AAkCD,qCAAqC;AACrC,wBAAgB,eAAe,CAAC,GAAG,KAAA,EAAE,WAAW,KAAA,qBAI/C;AA0JD,6CAA6C;AAC7C,wBAAgB,mBAAmB,CAAC,GAAG,KAAA,EAAE,eAAe,KAAA,qBAQvD;AAED,yDAAyD;AACzD,wBAAgB,yBAAyB,CAAC,UAAU,KAAA,OAgBnD;AAeD,iCAAiC;AACjC,wBAAgB,aAAa,CAAC,GAAG,KAAA,EAAE,SAAS,KAAA,qBAI3C;AA+HD;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAJxB,MAIwB,EAAE,WAAW,OAAA,GAFnC,QAAM,SAAS,CA+B3B"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Render the 1.x-shaped internal model as a CycloneDX 2.0 document: the
|
|
3
|
+
* document sections, reference integrity and the render report. The public
|
|
4
|
+
* entry points are re-exported from cyclonedx20.js.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Render the 1.x-shaped internal model as a CycloneDX 2.0 document and report
|
|
8
|
+
* what could not be carried. Pure: the input is never mutated and the output
|
|
9
|
+
* shares no objects with it. Deterministic: the same input renders to the
|
|
10
|
+
* same JSON.
|
|
11
|
+
*
|
|
12
|
+
* @param {object} internalBom BOM in the 1.x shape
|
|
13
|
+
* @param {{hardwareMapper?: Function, hardwareOptions?: {includeSensitiveIdentifiers?: boolean, identifierPolicy?: string}}} [context]
|
|
14
|
+
* What the render may use besides the model: `hardwareMapper` is the
|
|
15
|
+
* optional toCdx20HardwareComponent of @cdxgen/cdx-hbom and
|
|
16
|
+
* `hardwareOptions` its identifier options (see hbomLoader.js:
|
|
17
|
+
* hardwareRenderContext and cyclonedx20RenderHardware.js). The output
|
|
18
|
+
* depends only on the model and this context.
|
|
19
|
+
* @returns {{bomJson: object, report: {drops: Object<string, number>, rewrites: Object<string, number>, customSchemes: string[], droppedMethods: Array<{reason: string, technique: string}>}}}
|
|
20
|
+
* The 2.0 document, the counts of values the render could not carry
|
|
21
|
+
* (`drops`) and of values it rewrote without losing data (`rewrites`), by
|
|
22
|
+
* label
|
|
23
|
+
*/
|
|
24
|
+
export declare function renderCycloneDx20WithReport(internalBom: object, context?: {
|
|
25
|
+
hardwareMapper?: Function;
|
|
26
|
+
hardwareOptions?: {
|
|
27
|
+
includeSensitiveIdentifiers?: boolean;
|
|
28
|
+
identifierPolicy?: string;
|
|
29
|
+
};
|
|
30
|
+
}): {
|
|
31
|
+
bomJson: object;
|
|
32
|
+
report: {
|
|
33
|
+
drops: Record<string, number>;
|
|
34
|
+
rewrites: Record<string, number>;
|
|
35
|
+
customSchemes: string[];
|
|
36
|
+
droppedMethods: Array<{
|
|
37
|
+
reason: string;
|
|
38
|
+
technique: string;
|
|
39
|
+
}>;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* Render the 1.x-shaped internal model as a CycloneDX 2.0 document. Pure: the
|
|
44
|
+
* input is never mutated and the output shares no objects with it. What the
|
|
45
|
+
* render could not carry is logged through thoughtLog; use
|
|
46
|
+
* renderCycloneDx20WithReport for the counts.
|
|
47
|
+
*
|
|
48
|
+
* @param {object} internalBom BOM in the 1.x shape
|
|
49
|
+
* @param {object} [context] See renderCycloneDx20WithReport
|
|
50
|
+
* @returns {object} BOM in the 2.0 shape
|
|
51
|
+
*/
|
|
52
|
+
export declare function renderCycloneDx20(internalBom: object, context?: object): object;
|
|
53
|
+
//# sourceMappingURL=cyclonedx20Render.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cyclonedx20Render.d.ts","sourceRoot":"","sources":["../../../lib/inventory/cyclonedx20Render.js"],"names":[],"mappings":"AAAA;;;;GAIG;AA+dH;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,2BAA2B,CAAC,WAAW,EAZ5C,MAY4C,EAAE,OAAO,AAX7D,CAEuC,EAF/B;IAAC,cAAc,CAAC,WAAW;IAAC,eAAe,CAAC,EAAE;QAAC,2BAA2B,CAAC,EAAE,OAAO,CAAC;QAAC,gBAAgB,CAAC,EAAE,MAAM,CAAA;KAAC,CAAA;CAWtD,GALxD;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE;QAAC,KAAK,yBAAyB;QAAC,QAAQ,yBAAyB;QAAC,aAAa,EAAE,MAAM,EAAE,CAAC;QAAC,cAAc,EAAE,KAAK,CAAC;YAAC,MAAM,EAAE,MAAM,CAAC;YAAC,SAAS,EAAE,MAAM,CAAA;SAAC,CAAC,CAAA;KAAC,CAAA;CAAC,CA4C7L;AAwKD;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAAC,WAAW,EAJlC,MAIkC,EAAE,OAAO,AAHnD,CACA,EADQ,MAGgD,GAF9C,MAAM,CAIlB"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Render-side conversion of 1.x components, services and tools to CycloneDX
|
|
3
|
+
* 2.0 components (#/$defs/cyclonedx-component-2.0/$defs/component).
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Convert license choices: 1.x license objects and expressions may carry
|
|
7
|
+
* `bom-ref`, which the 2.0 licenseDeclaration renames to `refId`
|
|
8
|
+
* (#/$defs/cyclonedx-license-2.0/$defs/licenseDeclaration), and a license
|
|
9
|
+
* `text` is an attachment.
|
|
10
|
+
*
|
|
11
|
+
* @param {object[]} licenses 1.x license choices
|
|
12
|
+
* @param {object} stats Render counters
|
|
13
|
+
* @returns {object[]|undefined} 2.0 license choices
|
|
14
|
+
*/
|
|
15
|
+
export declare function convertLicenses(licenses: object[], stats: object): object[] | undefined;
|
|
16
|
+
/**
|
|
17
|
+
* Convert a 1.x attachment ({contentType, encoding, content}) to the 2.0
|
|
18
|
+
* attachment (#/$defs/cyclonedx-common-2.0/$defs/attachment, `mediaType`
|
|
19
|
+
* instead of `contentType`, `content` required). A content type that is not
|
|
20
|
+
* a media type the 2.0 pattern accepts is counted and left out.
|
|
21
|
+
*
|
|
22
|
+
* @param {object} attachment 1.x attachment
|
|
23
|
+
* @param {object} stats Render counters
|
|
24
|
+
* @param {string} label Counter label of the attachment's position
|
|
25
|
+
* @returns {object|undefined} 2.0 attachment, or undefined without content
|
|
26
|
+
*/
|
|
27
|
+
export declare function convertAttachment(attachment: object, stats: object, label: string): object | undefined;
|
|
28
|
+
/**
|
|
29
|
+
* Convert release notes
|
|
30
|
+
* (#/$defs/cyclonedx-release-notes-2.0/$defs/releaseNotes): the members are
|
|
31
|
+
* the same, but each note's `text` is an attachment and a note requires it.
|
|
32
|
+
*
|
|
33
|
+
* @param {object} releaseNotes 1.x release notes
|
|
34
|
+
* @param {object} stats Render counters
|
|
35
|
+
* @returns {object|undefined} 2.0 release notes
|
|
36
|
+
*/
|
|
37
|
+
export declare function convertReleaseNotes(releaseNotes: object, stats: object): object | undefined;
|
|
38
|
+
/** Map a 1.x free-text data classification onto the 2.0 enum or `{name}`. */
|
|
39
|
+
export declare function toDataClassification(classification: any): any;
|
|
40
|
+
/**
|
|
41
|
+
* Convert 1.x dataGovernance ({custodians, stewards, owners} of
|
|
42
|
+
* organization-or-contact entries) into the 2.0 array of parties
|
|
43
|
+
* (#/$defs/cyclonedx-data-2.0/$defs/dataGovernance) with the matching roles.
|
|
44
|
+
*/
|
|
45
|
+
export declare function convertGovernance(governance: any, stats: any): any[] | undefined;
|
|
46
|
+
/** Convert 1.x data contents ({attachment, url, properties}). */
|
|
47
|
+
export declare function convertDataContents(contents: any, stats: any): {
|
|
48
|
+
attachment: object;
|
|
49
|
+
} | undefined;
|
|
50
|
+
/**
|
|
51
|
+
* Convert one 1.x component to the 2.0 component shape
|
|
52
|
+
* (#/$defs/cyclonedx-component-2.0/$defs/component). Fields with no 2.0
|
|
53
|
+
* home (`signature`, the deprecated `modified`, …) are counted.
|
|
54
|
+
*/
|
|
55
|
+
export declare function convertComponent(component: any, stats: any): any;
|
|
56
|
+
/**
|
|
57
|
+
* Convert one 1.x service into a 2.0 component of type `service`
|
|
58
|
+
* (#/$defs/cyclonedx-component-2.0/$defs/component/properties/type). The
|
|
59
|
+
* provider becomes a party with the `provider` role. `authenticated`,
|
|
60
|
+
* `x-trust-boundary` and `trustZone` have no 2.0 field; they ride as the
|
|
61
|
+
* cdx:service:* properties of CARRIED_SERVICE_PROPERTIES, after the service's
|
|
62
|
+
* own properties, and the reader turns them back into the 1.x fields.
|
|
63
|
+
*/
|
|
64
|
+
export declare function convertService(service: any, stats: any): any;
|
|
65
|
+
/**
|
|
66
|
+
* Convert metadata.tools: the 1.x {components, services} object, or the
|
|
67
|
+
* legacy 1.5 array. 2.0 tools hold only `components`
|
|
68
|
+
* (#/$defs/cyclonedx-metadata-2.0/$defs/metadata/properties/tools).
|
|
69
|
+
*/
|
|
70
|
+
export declare function convertTools(tools: any, stats: any): {
|
|
71
|
+
components: any[];
|
|
72
|
+
} | undefined;
|
|
73
|
+
//# sourceMappingURL=cyclonedx20RenderComponents.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cyclonedx20RenderComponents.d.ts","sourceRoot":"","sources":["../../../lib/inventory/cyclonedx20RenderComponents.js"],"names":[],"mappings":"AAAA;;;GAGG;AAwEH;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAJ7B,MAAM,EAIuB,EAAE,KAAK,EAHpC,MAGoC,GAFlC,MAAM,EAAE,GAAC,SAAS,CAiC9B;AAMD;;;;;;;;;;GAUG;AACH,wBAAgB,iBAAiB,CAAC,UAAU,EALjC,MAKiC,EAAE,KAAK,EAJxC,MAIwC,EAAE,KAAK,EAH/C,MAG+C,GAF7C,MAAM,GAAC,SAAS,CAkC5B;AAED;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CAAC,YAAY,EAJrC,MAIqC,EAAE,KAAK,EAH5C,MAG4C,GAF1C,MAAM,GAAC,SAAS,CA0B5B;AAED,6EAA6E;AAC7E,wBAAgB,oBAAoB,CAAC,cAAc,KAAA,OAUlD;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,UAAU,KAAA,EAAE,KAAK,KAAA,qBA2BlD;AAED,iEAAiE;AACjE,wBAAgB,mBAAmB,CAAC,QAAQ,KAAA,EAAE,KAAK,KAAA;;cAuBlD;AA0ND;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,SAAS,KAAA,EAAE,KAAK,KAAA,OAyChD;AA8DD;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,OAAO,KAAA,EAAE,KAAK,KAAA,OA4C5C;AAwCD;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,KAAK,KAAA,EAAE,KAAK,KAAA;;cAmBxC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Render-side conversion of the 1.x definitions standards and the root
|
|
3
|
+
* `declarations` (#/$defs/cyclonedx-standard-2.0 and
|
|
4
|
+
* #/$defs/cyclonedx-declaration-2.0). Their members keep their names; the
|
|
5
|
+
* 1.x `bom-ref` becomes `refId`, organizations and contacts take the 2.0
|
|
6
|
+
* common shapes, attachments the 2.0 attachment, and a 1.x JSF `signature`
|
|
7
|
+
* is counted and left out (see countSignatureDrop).
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Convert 1.x definitions.standards
|
|
11
|
+
* (#/$defs/cyclonedx-standard-2.0/$defs/standards). Requirement `parent`
|
|
12
|
+
* and level `requirements` are refLinkType values; the refIds keep the
|
|
13
|
+
* bom-ref values, so they still resolve.
|
|
14
|
+
*
|
|
15
|
+
* @param {object[]} standards 1.x standards
|
|
16
|
+
* @param {object} stats Render counters
|
|
17
|
+
* @returns {object[]|undefined} 2.0 standards
|
|
18
|
+
*/
|
|
19
|
+
export declare function convertStandards(standards: object[], stats: object): object[] | undefined;
|
|
20
|
+
/**
|
|
21
|
+
* Render the root `declarations`
|
|
22
|
+
* (#/$defs/cyclonedx-declaration-2.0/$defs/declarations).
|
|
23
|
+
*
|
|
24
|
+
* @param {object} declarations 1.x declarations
|
|
25
|
+
* @param {object} stats Render counters
|
|
26
|
+
* @returns {object|undefined} 2.0 declarations
|
|
27
|
+
*/
|
|
28
|
+
export declare function renderDeclarations(declarations: object, stats: object): object | undefined;
|
|
29
|
+
//# sourceMappingURL=cyclonedx20RenderDefinitions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cyclonedx20RenderDefinitions.d.ts","sourceRoot":"","sources":["../../../lib/inventory/cyclonedx20RenderDefinitions.js"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AA2FH;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAAC,SAAS,EAJ/B,MAAM,EAIyB,EAAE,KAAK,EAHtC,MAGsC,GAFpC,MAAM,EAAE,GAAC,SAAS,CA6C9B;AA8GD;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,YAAY,EAJpC,MAIoC,EAAE,KAAK,EAH3C,MAG2C,GAFzC,MAAM,GAAC,SAAS,CAyI5B"}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Render-side conversion of 1.x component evidence and cryptoProperties to
|
|
3
|
+
* the CycloneDX 2.0 shapes (#/$defs/cyclonedx-component-2.0/$defs/componentEvidence,
|
|
4
|
+
* #/$defs/cyclonedx-cryptography-2.0/$defs/cryptoProperties).
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* The refId prefix of the party derived for a tool other than cdxgen. Any
|
|
8
|
+
* refId that starts with it is a valid refIdType
|
|
9
|
+
* (#/$defs/cyclonedx-common-2.0/$defs/refIdType: non-empty and not starting
|
|
10
|
+
* with the BOM-Link intro `urn:cdx:`), whatever the tool's own refId is, so
|
|
11
|
+
* the tool refId is appended unchanged and the party refId stays readable and
|
|
12
|
+
* deterministic.
|
|
13
|
+
*/
|
|
14
|
+
export declare const TOOL_PARTY_REF_ID_PREFIX = "party-tool-";
|
|
15
|
+
/**
|
|
16
|
+
* What the claims cdxgen writes at 2.0 are attributed with (#4591). cdxgen
|
|
17
|
+
* claims only analysis it did:
|
|
18
|
+
*
|
|
19
|
+
* - `toolRefId` is the refId of the cdxgen tool component, present only when
|
|
20
|
+
* the BOM's `metadata.tools` lists cdxgen with a `bom-ref` (the tool named
|
|
21
|
+
* "cdxgen", the same match findCdxgenToolBomRef in
|
|
22
|
+
* lib/inventory/citations.js makes). Identity evidence carries cdxgen's
|
|
23
|
+
* assertion, its tool and method results only when this is set.
|
|
24
|
+
* - `assertingTool` is set only without `toolRefId`: the first other tool
|
|
25
|
+
* component with a `bom-ref` (`{refId, toolRefId, label?}`), whose party
|
|
26
|
+
* asserts the component identifiers (`identifiers[].party` is required).
|
|
27
|
+
* With neither, cdxgen, as the converting tool, asserts the identifiers it
|
|
28
|
+
* wrote.
|
|
29
|
+
* - `timestamp` is the BOM timestamp when it has one.
|
|
30
|
+
*
|
|
31
|
+
* Nothing is invented: absent members stay absent.
|
|
32
|
+
*
|
|
33
|
+
* @param {object} bom BOM in the 1.x shape (only `metadata` is read)
|
|
34
|
+
* @returns {{toolRefId?: string, assertingTool?: {refId: string, toolRefId: string, label?: string}, timestamp?: string}} Claim context
|
|
35
|
+
*/
|
|
36
|
+
export declare function identityClaimContext(bom: object): {
|
|
37
|
+
toolRefId?: string;
|
|
38
|
+
assertingTool?: {
|
|
39
|
+
refId: string;
|
|
40
|
+
toolRefId: string;
|
|
41
|
+
label?: string;
|
|
42
|
+
};
|
|
43
|
+
timestamp?: string;
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* The refId of the party asserting the component identifiers: the cdxgen
|
|
47
|
+
* party when cdxgen is the listed tool or no tool is listed, else the party
|
|
48
|
+
* of the first other listed tool (see identityClaimContext).
|
|
49
|
+
*
|
|
50
|
+
* @param {object} claims Claim context from identityClaimContext
|
|
51
|
+
* @returns {string} Party refId
|
|
52
|
+
*/
|
|
53
|
+
export declare function identifierPartyRefId(claims: object): string;
|
|
54
|
+
/**
|
|
55
|
+
* The parties the renderer derives from the claim context, in the order it
|
|
56
|
+
* appends them: the cdxgen party, then the asserting tool's party when there
|
|
57
|
+
* is one. Each is a party (#/$defs/cyclonedx-party-2.0/$defs/party) with the
|
|
58
|
+
* `asserter` role and a system identity
|
|
59
|
+
* (#/$defs/cyclonedx-party-2.0/$defs/system, kind `automation`) whose `ref`
|
|
60
|
+
* names the tool component only when that refId is declared. The renderer
|
|
61
|
+
* declares one only when the document references it; the reader drops one
|
|
62
|
+
* that matches exactly, since the render derives it again.
|
|
63
|
+
*
|
|
64
|
+
* @param {object} claims Claim context from identityClaimContext
|
|
65
|
+
* @param {Set<string>} declared refIds declared in the document
|
|
66
|
+
* @returns {object[]} Party declarations
|
|
67
|
+
*/
|
|
68
|
+
export declare function derivedPartyDeclarations(claims: object, declared: Set<string>): object[];
|
|
69
|
+
/**
|
|
70
|
+
* Convert one 1.x identity entry to componentIdentityEvidence
|
|
71
|
+
* (#/$defs/cyclonedx-component-2.0/$defs/componentIdentityEvidence). When
|
|
72
|
+
* cdxgen is the listed tool (#4591), the entry is cdxgen's attributed claim:
|
|
73
|
+
* `tools` names the helper recorded on the entry or, failing that, the cdxgen
|
|
74
|
+
* tool; `assertion` credits the cdxgen party as asserter
|
|
75
|
+
* (#/$defs/cyclonedx-evidence-2.0/$defs/assertion); and a method with a
|
|
76
|
+
* matched value has the result `detected`. For another tool's BOM cdxgen did
|
|
77
|
+
* not do that analysis, so none of these is added; the entry's own `tools`
|
|
78
|
+
* are kept. `timestamp` is the BOM's own when it has one.
|
|
79
|
+
*
|
|
80
|
+
* @param {object} entry 1.x identity evidence entry
|
|
81
|
+
* @param {object} stats Render counters from createRenderStats
|
|
82
|
+
* @returns {object|undefined} The 2.0 entry, or undefined without a field
|
|
83
|
+
*/
|
|
84
|
+
export declare function convertIdentityEntry(entry: object, stats: object): object | undefined;
|
|
85
|
+
/**
|
|
86
|
+
* Convert component evidence
|
|
87
|
+
* (#/$defs/cyclonedx-component-2.0/$defs/componentEvidence). The 1.x
|
|
88
|
+
* `callstack` object becomes the `callStacks` array; identity `field` becomes
|
|
89
|
+
* `scheme`. Every nested object is cloned, so nothing is shared with the
|
|
90
|
+
* input.
|
|
91
|
+
*/
|
|
92
|
+
export declare function convertComponentEvidence(evidence: any, stats: any): {
|
|
93
|
+
identity: any[];
|
|
94
|
+
occurrences: any[];
|
|
95
|
+
callStacks: {
|
|
96
|
+
frames: any[];
|
|
97
|
+
}[];
|
|
98
|
+
licenses: any[];
|
|
99
|
+
copyright: any[];
|
|
100
|
+
} | undefined;
|
|
101
|
+
/**
|
|
102
|
+
* Convert cryptoProperties
|
|
103
|
+
* (#/$defs/cyclonedx-cryptography-2.0/$defs/cryptoProperties, required
|
|
104
|
+
* `[assetType]`): drop the deprecated free-text `curve` (2.0 keeps only
|
|
105
|
+
* `ellipticCurve`) and the algorithm families and protocol types the pinned
|
|
106
|
+
* 2.0 enums do not list, move the deprecated 1.x reference members into
|
|
107
|
+
* `relatedCryptographicAssets`, and count every member 2.0 has no field for.
|
|
108
|
+
*/
|
|
109
|
+
export declare function convertCryptoProperties(cryptoProperties: any, stats: any): any;
|
|
110
|
+
//# sourceMappingURL=cyclonedx20RenderEvidence.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cyclonedx20RenderEvidence.d.ts","sourceRoot":"","sources":["../../../lib/inventory/cyclonedx20RenderEvidence.js"],"names":[],"mappings":"AAAA;;;;GAIG;AA6FH;;;;;;;GAOG;AACH,eAAO,MAAM,wBAAwB,gBAAgB,CAAC;AAEtD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAH7B,MAG6B,GAF3B;IAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,aAAa,CAAC,EAAE;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAC,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAC,CAgCxH;AAED;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAHhC,MAGgC,GAF9B,MAAM,CAIlB;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,wBAAwB,CAAC,MAAM,EAJpC,MAIoC,EAAE,QAAQ,EAH9C,GAAG,CAAC,MAAM,CAGoC,GAF5C,MAAM,EAAE,CA0BpB;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAJ/B,MAI+B,EAAE,KAAK,EAHtC,MAGsC,GAFpC,MAAM,GAAC,SAAS,CA6C5B;AAoID;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CAAC,QAAQ,KAAA,EAAE,KAAK,KAAA;;;;;;;;cAkDvD;AAiPD;;;;;;;GAOG;AACH,wBAAgB,uBAAuB,CAAC,gBAAgB,KAAA,EAAE,KAAK,KAAA,OAiB9D"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hardware components at 2.0 (cdxgen/cdxgen#4755). What each `cdx:hbom:*`
|
|
3
|
+
* property means in the 2.0 draft is owned by @cdxgen/cdx-hbom, whose
|
|
4
|
+
* optional `./cdx20` export provides `toCdx20HardwareComponent(component,
|
|
5
|
+
* {partyRefId, includeSensitiveIdentifiers, identifierPolicy})`. The caller
|
|
6
|
+
* loads it (lib/inventory/hbomLoader.js: hardwareRenderContext) and passes
|
|
7
|
+
* it, with those options, to renderCycloneDx20 in the render context, so the
|
|
8
|
+
* render stays a pure function of its arguments.
|
|
9
|
+
*
|
|
10
|
+
* The renderer converts the component as usual and then takes only these
|
|
11
|
+
* members from the mapper's result, each checked against the pinned schema:
|
|
12
|
+
*
|
|
13
|
+
* - `identifiers`: only groups asserted by the party the renderer passed
|
|
14
|
+
* (the one its own identifiers use, which it declares when referenced).
|
|
15
|
+
* Their identities are appended to that party's group, or added as a new
|
|
16
|
+
* group, so a purl identity is never replaced. Only identities with a
|
|
17
|
+
* scheme from the identityScheme enum (or a custom `{name}`) and a
|
|
18
|
+
* non-empty value are taken.
|
|
19
|
+
* - `classification` (#/$defs/cyclonedx-physical-2.0/$defs/classification):
|
|
20
|
+
* `category`, `subcategory`, and `codes` that are taxonomyCode objects
|
|
21
|
+
* (`{standard, value}`); a bare string code is dropped and counted.
|
|
22
|
+
* - a manufacturer party, when the generic conversion produced none.
|
|
23
|
+
*
|
|
24
|
+
* Every `cdx:hbom:*` property stays: the hbom audit rules read them.
|
|
25
|
+
*/
|
|
26
|
+
/** True when the 1.x component carries at least one cdx:hbom:* property. */
|
|
27
|
+
export declare function isHardwareComponent(component: any): any;
|
|
28
|
+
/**
|
|
29
|
+
* Add the hardware mapper's 2.0 members to a converted hardware component.
|
|
30
|
+
* Without a mapper, or for a component without cdx:hbom:* properties, the
|
|
31
|
+
* converted component is returned unchanged. The mapper gets a clone of the
|
|
32
|
+
* 1.x component, the asserting party refId the generic identifiers use (so
|
|
33
|
+
* its identifiers resolve to the party the renderer declares) and the
|
|
34
|
+
* identifier options of the render context (`stats.hardwareOptions`).
|
|
35
|
+
*
|
|
36
|
+
* @param {object} component The 1.x component
|
|
37
|
+
* @param {object} converted Its generic 2.0 conversion, extended in place
|
|
38
|
+
* @param {object} stats Render counters with the optional `hardwareMapper`
|
|
39
|
+
* @returns {object} The converted component
|
|
40
|
+
*/
|
|
41
|
+
export declare function applyHardwareMapping(component: object, converted: object, stats: object): object;
|
|
42
|
+
//# sourceMappingURL=cyclonedx20RenderHardware.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cyclonedx20RenderHardware.d.ts","sourceRoot":"","sources":["../../../lib/inventory/cyclonedx20RenderHardware.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAeH,4EAA4E;AAC5E,wBAAgB,mBAAmB,CAAC,SAAS,KAAA,OAQ5C;AAqHD;;;;;;;;;;;;GAYG;AACH,wBAAgB,oBAAoB,CAAC,SAAS,EALnC,MAKmC,EAAE,SAAS,EAJ9C,MAI8C,EAAE,KAAK,EAHrD,MAGqD,GAFnD,MAAM,CA0BlB"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Render-side conversion of 1.x patents, patent families and patent
|
|
3
|
+
* assertions (#/$defs/cyclonedx-patent-2.0). The members are the same; the
|
|
4
|
+
* 1.x `bom-ref` becomes `refId`, and organizations and contacts take the
|
|
5
|
+
* 2.0 common shapes.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Convert 1.x definitions.patents: patents and patent families.
|
|
9
|
+
*
|
|
10
|
+
* @param {object[]} patents 1.x patents and patent families
|
|
11
|
+
* @param {object} stats Render counters
|
|
12
|
+
* @returns {object[]|undefined} 2.0 patents
|
|
13
|
+
*/
|
|
14
|
+
export declare function convertPatents(patents: object[], stats: object): object[] | undefined;
|
|
15
|
+
/**
|
|
16
|
+
* Convert 1.x patentAssertions
|
|
17
|
+
* (#/$defs/cyclonedx-patent-2.0/$defs/patentAssertions): the asserter is an
|
|
18
|
+
* organization, a contact or a refLinkType string.
|
|
19
|
+
*
|
|
20
|
+
* @param {object[]} assertions 1.x patent assertions
|
|
21
|
+
* @param {object} stats Render counters
|
|
22
|
+
* @returns {object[]|undefined} 2.0 patent assertions, or undefined when
|
|
23
|
+
* none is left
|
|
24
|
+
*/
|
|
25
|
+
export declare function convertPatentAssertions(assertions: object[], stats: object): object[] | undefined;
|
|
26
|
+
//# sourceMappingURL=cyclonedx20RenderPatents.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cyclonedx20RenderPatents.d.ts","sourceRoot":"","sources":["../../../lib/inventory/cyclonedx20RenderPatents.js"],"names":[],"mappings":"AAAA;;;;;GAKG;AA4EH;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAJ3B,MAAM,EAIqB,EAAE,KAAK,EAHlC,MAGkC,GAFhC,MAAM,EAAE,GAAC,SAAS,CA6C9B;AAED;;;;;;;;;GASG;AACH,wBAAgB,uBAAuB,CAAC,UAAU,EALvC,MAAM,EAKiC,EAAE,KAAK,EAJ9C,MAI8C,GAH5C,MAAM,EAAE,GAAC,SAAS,CAiC9B"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reference integrity of a rendered CycloneDX 2.0 document: every refId is
|
|
3
|
+
* unique (the 2.0 refIdType rule "Every `refId` shall be unique within the
|
|
4
|
+
* document", which JSON Schema cannot check), and dependency and
|
|
5
|
+
* vulnerability references resolve to a declared refId or a BOM-Link.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Make every refId unique. The roots are walked in order, so the earliest
|
|
9
|
+
* root keeps a repeated refId; pass the inventories before metadata so the
|
|
10
|
+
* subject of a self-scan keeps its members when it repeats the refId of the
|
|
11
|
+
* tool. A later declaration with an already declared refId becomes:
|
|
12
|
+
*
|
|
13
|
+
* - a componentReference or partyReference `{ref}` when it sits in a slot
|
|
14
|
+
* that accepts one and an earlier declaration of the same kind already
|
|
15
|
+
* holds every member it has (nothing is lost);
|
|
16
|
+
* - nothing, in the definitions registry, under the same condition (counted
|
|
17
|
+
* as already declared), and also when an inventory declares the refId
|
|
18
|
+
* with other members (the members only the registry entry had are
|
|
19
|
+
* counted as dropped);
|
|
20
|
+
* - unchanged, when neither it nor an earlier declaration sits in a
|
|
21
|
+
* component or party slot (counted);
|
|
22
|
+
* - otherwise the same object under a new refId `<refId>-dup-<n>`, so no data
|
|
23
|
+
* is lost and references to the refId keep resolving to the first
|
|
24
|
+
* declaration.
|
|
25
|
+
*
|
|
26
|
+
* @param {Array<{section: string, value: *}>} roots Rendered sections, the
|
|
27
|
+
* definitions root marked with `section: "definitions"`
|
|
28
|
+
* @param {object} stats Render counters
|
|
29
|
+
*/
|
|
30
|
+
export declare function dedupeRefIds(roots: Array<{
|
|
31
|
+
section: string;
|
|
32
|
+
value: any;
|
|
33
|
+
}>, stats: object): void;
|
|
34
|
+
/**
|
|
35
|
+
* Keep only dependency references that resolve: an entry whose `ref` names
|
|
36
|
+
* nothing declared is dropped, and so is each such `dependsOn` and
|
|
37
|
+
* `provides` member. An emptied `dependsOn` stays, since an empty list says
|
|
38
|
+
* the component has no dependencies.
|
|
39
|
+
*
|
|
40
|
+
* @param {object[]|undefined} dependencies Rendered dependencies
|
|
41
|
+
* @param {Set<string>} declared Every declared refId
|
|
42
|
+
* @param {object} stats Render counters
|
|
43
|
+
* @returns {object[]|undefined} The dependencies left, or undefined
|
|
44
|
+
*/
|
|
45
|
+
export declare function resolveDependencyRefs(dependencies: object[] | undefined, declared: Set<string>, stats: object): object[] | undefined;
|
|
46
|
+
/**
|
|
47
|
+
* Drop vulnerability `affects` entries whose `ref` resolves to nothing, and
|
|
48
|
+
* an `affects` list left empty.
|
|
49
|
+
*
|
|
50
|
+
* @param {object[]|undefined} vulnerabilities Rendered vulnerabilities
|
|
51
|
+
* @param {Set<string>} declared Every declared refId
|
|
52
|
+
* @param {object} stats Render counters
|
|
53
|
+
*/
|
|
54
|
+
export declare function resolveAffectsRefs(vulnerabilities: object[] | undefined, declared: Set<string>, stats: object): void;
|
|
55
|
+
//# sourceMappingURL=cyclonedx20RenderRefIds.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cyclonedx20RenderRefIds.d.ts","sourceRoot":"","sources":["../../../lib/inventory/cyclonedx20RenderRefIds.js"],"names":[],"mappings":"AAAA;;;;;GAKG;AAqGH;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAJvB,KAAK,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,GAAC,CAAA;CAAC,CAIV,EAAE,KAAK,EAF9B,MAE8B,QA2GxC;AAKD;;;;;;;;;;GAUG;AACH,wBAAgB,qBAAqB,CAAC,YAAY,EALvC,MAAM,EAAE,GAAC,SAK8B,EAAE,QAAQ,EAJjD,GAAG,CAAC,MAAM,CAIuC,EAAE,KAAK,EAHxD,MAGwD,GAFtD,MAAM,EAAE,GAAC,SAAS,CA6B9B;AAED;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,eAAe,EAJvC,MAAM,EAAE,GAAC,SAI8B,EAAE,QAAQ,EAHjD,GAAG,CAAC,MAAM,CAGuC,EAAE,KAAK,EAFxD,MAEwD,QAwBlE"}
|