@cdxgen/cdxgen 0.0.1 → 13.0.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 +921 -87
- package/bin/audit.js +239 -0
- package/bin/cdxgen.js +2324 -0
- package/bin/convert.js +213 -0
- package/bin/evinse.js +353 -0
- package/bin/hbom.js +495 -0
- package/bin/repl.js +2224 -0
- package/bin/sign.js +195 -0
- package/bin/tracebom.js +295 -0
- package/bin/validate.js +268 -0
- package/bin/verify.js +189 -0
- package/data/README.md +307 -0
- package/data/bom-1.4.schema.json +1605 -0
- package/data/bom-1.5.schema.json +3660 -0
- package/data/bom-1.6.schema.json +5511 -0
- package/data/bom-1.7.schema.json +6700 -0
- package/data/cbomosdb-queries.json +68 -0
- package/data/component-tags.json +339 -0
- package/data/container-knowledge-index.json +125 -0
- package/data/cosdb-queries.json +17 -0
- package/data/crypto-oid.json +1998 -0
- package/data/cryptography-defs.json +3793 -0
- package/data/cryptography-defs.schema.json +576 -0
- package/data/cyclonedx-2.0-bundled.schema.json +7182 -0
- package/data/frameworks-list.json +219 -0
- package/data/glibc-stdlib.json +117 -0
- package/data/gtfobins-index.json +6296 -0
- package/data/helpers/init.gradle +71 -0
- package/data/jsf-0.82.schema.json +211 -0
- package/data/known-licenses.json +82 -0
- package/data/lic-mapping.json +338 -0
- package/data/license-aliases.json +6624 -0
- package/data/license-db.json +39059 -0
- package/data/license-deprecations.json +302 -0
- package/data/lolbas-index.json +150 -0
- package/data/predictive-audit-allowlist.json +11 -0
- package/data/pypi-pkg-aliases.json +1199 -0
- package/data/python-stdlib.json +308 -0
- package/data/queries-darwin.json +193 -0
- package/data/queries-win.json +257 -0
- package/data/queries.json +268 -0
- package/data/ruby-known-modules.json +281 -0
- package/data/rules/ai-agent-governance.yaml +323 -0
- package/data/rules/ai-bom.yaml +268 -0
- package/data/rules/ai-oversight.yaml +186 -0
- package/data/rules/ai-provenance.yaml +92 -0
- package/data/rules/asar-archives.yaml +150 -0
- package/data/rules/cbom-security.yaml +165 -0
- package/data/rules/chrome-extensions.yaml +248 -0
- package/data/rules/ci-permissions.yaml +802 -0
- package/data/rules/container-risk.yaml +353 -0
- package/data/rules/dependency-sources.yaml +236 -0
- package/data/rules/golem-go.yaml +229 -0
- package/data/rules/hbom-compliance.yaml +325 -0
- package/data/rules/hbom-performance.yaml +307 -0
- package/data/rules/hbom-security.yaml +248 -0
- package/data/rules/host-topology.yaml +165 -0
- package/data/rules/mcp-servers.yaml +388 -0
- package/data/rules/obom-runtime.yaml +1776 -0
- package/data/rules/package-integrity.yaml +364 -0
- package/data/rules/rootfs-hardening.yaml +179 -0
- package/data/rules/vscode-extensions.yaml +237 -0
- package/data/spdx-export.schema.json +6794 -0
- package/data/spdx-license-list.json +7449 -0
- package/data/spdx-licenses.json +759 -0
- package/data/spdx.schema.json +819 -0
- package/data/templates/README.md +3 -0
- package/data/templates/asvs-4.0.3.cdx.json +2943 -0
- package/data/templates/asvs-5.0.cdx.json +3046 -0
- package/data/templates/bsimm-v13.cdx.json +1008 -0
- package/data/templates/masvs-2.0.0.cdx.json +225 -0
- package/data/templates/nist-ssdf-1.1.cdx.json +828 -0
- package/data/templates/pcissc-secure-slc-1.1.cdx.json +1027 -0
- package/data/templates/scvs-1.0.0.cdx.json +813 -0
- package/data/templates/ssaf-DRAFT-2023-11.cdx.json +127 -0
- package/data/vendor-alias.json +41967 -0
- package/data/wrapdb-releases.json +4227 -0
- package/index.cjs +15 -0
- package/lib/audit/index.js +2800 -0
- package/lib/audit/progress.js +114 -0
- package/lib/audit/reporters.js +937 -0
- package/lib/audit/scoring.js +560 -0
- package/lib/audit/targets.js +798 -0
- package/lib/cli/bomAssembly.js +1833 -0
- package/lib/cli/cliOptions.js +513 -0
- package/lib/cli/index.js +2759 -0
- package/lib/cli/jsBom.js +2087 -0
- package/lib/cli/jvmBom.js +1858 -0
- package/lib/cli/managedBom.js +2083 -0
- package/lib/cli/nativeBom.js +2125 -0
- package/lib/core/activity.js +1087 -0
- package/lib/core/env.js +719 -0
- package/lib/core/fs.js +1058 -0
- package/lib/core/httpClient.js +730 -0
- package/lib/core/logger.js +142 -0
- package/lib/core/parallel.js +323 -0
- package/lib/core/paths.js +70 -0
- package/lib/core/projectConfig.js +122 -0
- package/lib/core/propertySanitizer.js +174 -0
- package/lib/core/spdx.js +5 -0
- package/lib/core/state.js +59 -0
- package/lib/core/text.js +207 -0
- package/lib/core/ui.js +876 -0
- package/lib/core/urls.js +84 -0
- package/lib/ecosystems/asarutils.js +1636 -0
- package/lib/ecosystems/bunutils.js +402 -0
- package/lib/ecosystems/caxa.js +77 -0
- package/lib/ecosystems/chromextutils.js +1174 -0
- package/lib/ecosystems/cmakeResolver.js +587 -0
- package/lib/ecosystems/cppEvidence.js +305 -0
- package/lib/ecosystems/denoutils.js +1094 -0
- package/lib/ecosystems/dotnetutils.js +132 -0
- package/lib/ecosystems/ecosystems.js +2772 -0
- package/lib/ecosystems/golem.js +1807 -0
- package/lib/ecosystems/gradleutils.js +1048 -0
- package/lib/ecosystems/jsEvidence.js +317 -0
- package/lib/ecosystems/npmutils.js +586 -0
- package/lib/ecosystems/parsers-bazel.js +875 -0
- package/lib/ecosystems/parsers-dotnet.js +1430 -0
- package/lib/ecosystems/parsers-gleam.js +302 -0
- package/lib/ecosystems/parsers-go.js +818 -0
- package/lib/ecosystems/parsers-js.js +4222 -0
- package/lib/ecosystems/parsers-jvm.js +948 -0
- package/lib/ecosystems/parsers-misc.js +3191 -0
- package/lib/ecosystems/parsers-python.js +2070 -0
- package/lib/ecosystems/parsers-rust.js +1294 -0
- package/lib/ecosystems/parsers-zig.js +861 -0
- package/lib/ecosystems/pep770.js +341 -0
- package/lib/ecosystems/pylockutils.js +427 -0
- package/lib/ecosystems/pythonutils.js +1281 -0
- package/lib/ecosystems/registryProvenance.js +1003 -0
- package/lib/ecosystems/remote/huggingface.js +1343 -0
- package/lib/ecosystems/rubyutils.js +1629 -0
- package/lib/ecosystems/rusi.js +820 -0
- package/lib/ecosystems/sbtutils.js +972 -0
- package/lib/ecosystems/tea.js +607 -0
- package/lib/ecosystems/utils.js +575 -0
- package/lib/ecosystems/zigResolver.js +410 -0
- package/lib/evinser/db.js +145 -0
- package/lib/evinser/evinser.js +2362 -0
- package/lib/evinser/scalasem.js +65 -0
- package/lib/evinser/swiftsem.js +767 -0
- package/lib/helpers/annotationFormatter.js +84 -0
- package/lib/helpers/bomSigner.js +312 -0
- package/lib/helpers/exportUtils.js +160 -0
- package/lib/helpers/remote/dependency-track.js +117 -0
- package/lib/helpers/versutils.js +202 -0
- package/lib/helpers/vsixutils.js +1069 -0
- package/lib/inventory/agentFormulationParser.js +322 -0
- package/lib/inventory/aiCollector.js +2140 -0
- package/lib/inventory/aiInventory.js +414 -0
- package/lib/inventory/aiModelVariants.js +121 -0
- package/lib/inventory/aiOversightCollector.js +661 -0
- package/lib/inventory/aiProvenanceCollector.js +822 -0
- package/lib/inventory/analyzer.js +6089 -0
- package/lib/inventory/analyzerScope.js +807 -0
- package/lib/inventory/astWorker.js +20 -0
- package/lib/inventory/atomUtils.js +1092 -0
- package/lib/inventory/auditCategories.js +192 -0
- package/lib/inventory/bomUtils.js +369 -0
- package/lib/inventory/cacheCommands.js +182 -0
- package/lib/inventory/cacheDir.js +104 -0
- package/lib/inventory/cbomutils.js +590 -0
- package/lib/inventory/cdxrs.js +434 -0
- package/lib/inventory/ciParsers/azurePipelines.js +295 -0
- package/lib/inventory/ciParsers/circleCi.js +286 -0
- package/lib/inventory/ciParsers/common.js +24 -0
- package/lib/inventory/ciParsers/githubActions.js +2434 -0
- package/lib/inventory/ciParsers/gitlabCi.js +213 -0
- package/lib/inventory/ciParsers/jenkins.js +180 -0
- package/lib/inventory/citations.js +234 -0
- package/lib/inventory/communityAiConfigParser.js +756 -0
- package/lib/inventory/containerRisk.js +204 -0
- package/lib/inventory/cryptoAlgorithmFamily.js +258 -0
- package/lib/inventory/deps.js +807 -0
- package/lib/inventory/depsUtils.js +588 -0
- package/lib/inventory/display.js +2128 -0
- package/lib/inventory/dosai.js +601 -0
- package/lib/inventory/dosaiParsers.js +154 -0
- package/lib/inventory/dynamic.js +145 -0
- package/lib/inventory/envcontext.js +1789 -0
- package/lib/inventory/evidenceUtils.js +774 -0
- package/lib/inventory/fetchBatch.js +779 -0
- package/lib/inventory/fetchRate.js +255 -0
- package/lib/inventory/forgeEnricher.js +300 -0
- package/lib/inventory/formulationParsers.js +422 -0
- package/lib/inventory/gtfobins.js +339 -0
- package/lib/inventory/hbom.js +719 -0
- package/lib/inventory/hbomAnalysis.js +310 -0
- package/lib/inventory/hbomLoader.js +35 -0
- package/lib/inventory/hostTopology.js +835 -0
- package/lib/inventory/inventoryStats.js +100 -0
- package/lib/inventory/jsonLike.js +121 -0
- package/lib/inventory/licenseEnhancer.js +918 -0
- package/lib/inventory/lolbas.js +285 -0
- package/lib/inventory/mcp.js +253 -0
- package/lib/inventory/mcpConfigParser.js +683 -0
- package/lib/inventory/mcpDiscovery.js +112 -0
- package/lib/inventory/mcpPinning.js +209 -0
- package/lib/inventory/osPackageResolver.js +493 -0
- package/lib/inventory/osinfo.js +277 -0
- package/lib/inventory/osqueryTransform.js +274 -0
- package/lib/inventory/plugins.js +466 -0
- package/lib/inventory/protobom.js +231 -0
- package/lib/inventory/protobomLoader.js +43 -0
- package/lib/inventory/provenanceUtils.js +224 -0
- package/lib/inventory/purl.js +749 -0
- package/lib/inventory/rustFormulationParser.js +339 -0
- package/lib/inventory/sbomDocument.js +340 -0
- package/lib/inventory/source.js +1488 -0
- package/lib/inventory/spdx.js +361 -0
- package/lib/inventory/spdxExpression.js +512 -0
- package/lib/inventory/spdxUtils.js +107 -0
- package/lib/inventory/table.js +263 -0
- package/lib/inventory/traceRunner.js +439 -0
- package/lib/inventory/unicodeScan.js +147 -0
- package/lib/managers/binary.js +3307 -0
- package/lib/managers/containerutils.js +125 -0
- package/lib/managers/docker.js +2145 -0
- package/lib/managers/dockerConnection.js +162 -0
- package/lib/managers/oci.js +704 -0
- package/lib/managers/piptree.js +267 -0
- package/lib/parsers/cmakeCache.js +199 -0
- package/lib/parsers/gguf.js +492 -0
- package/lib/parsers/gitAiNotes.js +233 -0
- package/lib/parsers/gitmodules.js +239 -0
- package/lib/parsers/htmlExtract.js +610 -0
- package/lib/parsers/huggingfaceManifest.js +551 -0
- package/lib/parsers/huggingfaceUtils.js +506 -0
- package/lib/parsers/iri.js +618 -0
- package/lib/parsers/npmrc.js +99 -0
- package/lib/parsers/ollama.js +101 -0
- package/lib/parsers/xml.js +841 -0
- package/lib/server/openapi.yaml +433 -0
- package/lib/server/server.js +616 -0
- package/lib/stages/postgen/annotator.js +977 -0
- package/lib/stages/postgen/auditBom.js +468 -0
- package/lib/stages/postgen/postgen.js +1239 -0
- package/lib/stages/postgen/ruleEngine.js +731 -0
- package/lib/stages/postgen/sortBom.js +195 -0
- package/lib/stages/postgen/spdxConverter.js +796 -0
- package/lib/stages/postgen/specVersionCompat.js +703 -0
- package/lib/stages/pregen/envAudit.js +388 -0
- package/lib/stages/pregen/pregen.js +637 -0
- package/lib/third-party/README.md +9 -0
- package/lib/third-party/arborist/CHANGELOG.md +1109 -0
- package/lib/third-party/arborist/LICENSE.md +20 -0
- package/lib/third-party/arborist/README.md +315 -0
- package/lib/third-party/arborist/lib/arborist/index.js +258 -0
- package/lib/third-party/arborist/lib/arborist/load-actual.js +605 -0
- package/lib/third-party/arborist/lib/arborist/load-virtual.js +300 -0
- package/lib/third-party/arborist/lib/bin-links.js +120 -0
- package/lib/third-party/arborist/lib/calc-dep-flags.js +130 -0
- package/lib/third-party/arborist/lib/case-insensitive-map.js +51 -0
- package/lib/third-party/arborist/lib/consistent-resolve.js +42 -0
- package/lib/third-party/arborist/lib/debug.js +50 -0
- package/lib/third-party/arborist/lib/dep-valid.js +190 -0
- package/lib/third-party/arborist/lib/edge.js +417 -0
- package/lib/third-party/arborist/lib/from-path.js +36 -0
- package/lib/third-party/arborist/lib/gather-dep-set.js +43 -0
- package/lib/third-party/arborist/lib/index.js +22 -0
- package/lib/third-party/arborist/lib/inventory.js +138 -0
- package/lib/third-party/arborist/lib/link.js +169 -0
- package/lib/third-party/arborist/lib/node.js +1673 -0
- package/lib/third-party/arborist/lib/npm-extension.js +45 -0
- package/lib/third-party/arborist/lib/override-resolves.js +11 -0
- package/lib/third-party/arborist/lib/override-set.js +319 -0
- package/lib/third-party/arborist/lib/package-extensions.js +289 -0
- package/lib/third-party/arborist/lib/printable.js +210 -0
- package/lib/third-party/arborist/lib/proc-log.js +30 -0
- package/lib/third-party/arborist/lib/realpath.js +100 -0
- package/lib/third-party/arborist/lib/relpath.js +4 -0
- package/lib/third-party/arborist/lib/shrinkwrap.js +1291 -0
- package/lib/third-party/arborist/lib/spec-from-lock.js +34 -0
- package/lib/third-party/arborist/lib/tree-check.js +165 -0
- package/lib/third-party/arborist/lib/validate-npm-package-name.js +107 -0
- package/lib/third-party/arborist/lib/version-from-tgz.js +51 -0
- package/lib/third-party/arborist/lib/yarn-lock.js +397 -0
- package/lib/validator/bomValidator.js +985 -0
- package/lib/validator/complianceEngine.js +241 -0
- package/lib/validator/complianceRules.js +1680 -0
- package/lib/validator/generated/runtime.mjs +17 -0
- package/lib/validator/generated/validate-1.6.mjs +21258 -0
- package/lib/validator/generated/validate-1.7.mjs +24803 -0
- package/lib/validator/generated/validate-2.0.mjs +22931 -0
- package/lib/validator/index.js +246 -0
- package/lib/validator/reporters/annotations.js +142 -0
- package/lib/validator/reporters/console.js +160 -0
- package/lib/validator/reporters/index.js +41 -0
- package/lib/validator/reporters/json.js +37 -0
- package/lib/validator/reporters/sarif.js +184 -0
- package/package.json +209 -26
- package/types/bin/audit.d.ts +3 -0
- package/types/bin/audit.d.ts.map +1 -0
- package/types/bin/cdxgen.d.ts +3 -0
- package/types/bin/cdxgen.d.ts.map +1 -0
- package/types/bin/convert.d.ts +3 -0
- package/types/bin/convert.d.ts.map +1 -0
- package/types/bin/evinse.d.ts +3 -0
- package/types/bin/evinse.d.ts.map +1 -0
- package/types/bin/hbom.d.ts +3 -0
- package/types/bin/hbom.d.ts.map +1 -0
- package/types/bin/repl.d.ts +3 -0
- package/types/bin/repl.d.ts.map +1 -0
- package/types/bin/sign.d.ts +3 -0
- package/types/bin/sign.d.ts.map +1 -0
- package/types/bin/tracebom.d.ts +3 -0
- package/types/bin/tracebom.d.ts.map +1 -0
- package/types/bin/validate.d.ts +14 -0
- package/types/bin/validate.d.ts.map +1 -0
- package/types/bin/verify.d.ts +3 -0
- package/types/bin/verify.d.ts.map +1 -0
- package/types/lib/audit/index.d.ts +153 -0
- package/types/lib/audit/index.d.ts.map +1 -0
- package/types/lib/audit/progress.d.ts +31 -0
- package/types/lib/audit/progress.d.ts.map +1 -0
- package/types/lib/audit/reporters.d.ts +62 -0
- package/types/lib/audit/reporters.d.ts.map +1 -0
- package/types/lib/audit/scoring.d.ts +36 -0
- package/types/lib/audit/scoring.d.ts.map +1 -0
- package/types/lib/audit/targets.d.ts +77 -0
- package/types/lib/audit/targets.d.ts.map +1 -0
- package/types/lib/cli/bomAssembly.d.ts +315 -0
- package/types/lib/cli/bomAssembly.d.ts.map +1 -0
- package/types/lib/cli/cliOptions.d.ts +156 -0
- package/types/lib/cli/cliOptions.d.ts.map +1 -0
- package/types/lib/cli/index.d.ts +107 -0
- package/types/lib/cli/index.d.ts.map +1 -0
- package/types/lib/cli/jsBom.d.ts +94 -0
- package/types/lib/cli/jsBom.d.ts.map +1 -0
- package/types/lib/cli/jvmBom.d.ts +54 -0
- package/types/lib/cli/jvmBom.d.ts.map +1 -0
- package/types/lib/cli/managedBom.d.ts +105 -0
- package/types/lib/cli/managedBom.d.ts.map +1 -0
- package/types/lib/cli/nativeBom.d.ts +143 -0
- package/types/lib/cli/nativeBom.d.ts.map +1 -0
- package/types/lib/core/activity.d.ts +178 -0
- package/types/lib/core/activity.d.ts.map +1 -0
- package/types/lib/core/env.d.ts +192 -0
- package/types/lib/core/env.d.ts.map +1 -0
- package/types/lib/core/fs.d.ts +158 -0
- package/types/lib/core/fs.d.ts.map +1 -0
- package/types/lib/core/httpClient.d.ts +149 -0
- package/types/lib/core/httpClient.d.ts.map +1 -0
- package/types/lib/core/logger.d.ts +28 -0
- package/types/lib/core/logger.d.ts.map +1 -0
- package/types/lib/core/parallel.d.ts +95 -0
- package/types/lib/core/parallel.d.ts.map +1 -0
- package/types/lib/core/paths.d.ts +36 -0
- package/types/lib/core/paths.d.ts.map +1 -0
- package/types/lib/core/projectConfig.d.ts +23 -0
- package/types/lib/core/projectConfig.d.ts.map +1 -0
- package/types/lib/core/propertySanitizer.d.ts +23 -0
- package/types/lib/core/propertySanitizer.d.ts.map +1 -0
- package/types/lib/core/spdx.d.ts +5 -0
- package/types/lib/core/spdx.d.ts.map +1 -0
- package/types/lib/core/state.d.ts +20 -0
- package/types/lib/core/state.d.ts.map +1 -0
- package/types/lib/core/text.d.ts +78 -0
- package/types/lib/core/text.d.ts.map +1 -0
- package/types/lib/core/ui.d.ts +87 -0
- package/types/lib/core/ui.d.ts.map +1 -0
- package/types/lib/core/urls.d.ts +43 -0
- package/types/lib/core/urls.d.ts.map +1 -0
- package/types/lib/ecosystems/asarutils.d.ts +71 -0
- package/types/lib/ecosystems/asarutils.d.ts.map +1 -0
- package/types/lib/ecosystems/bunutils.d.ts +38 -0
- package/types/lib/ecosystems/bunutils.d.ts.map +1 -0
- package/types/lib/ecosystems/caxa.d.ts +8 -0
- package/types/lib/ecosystems/caxa.d.ts.map +1 -0
- package/types/lib/ecosystems/chromextutils.d.ts +97 -0
- package/types/lib/ecosystems/chromextutils.d.ts.map +1 -0
- package/types/lib/ecosystems/cmakeResolver.d.ts +176 -0
- package/types/lib/ecosystems/cmakeResolver.d.ts.map +1 -0
- package/types/lib/ecosystems/cppEvidence.d.ts +35 -0
- package/types/lib/ecosystems/cppEvidence.d.ts.map +1 -0
- package/types/lib/ecosystems/denoutils.d.ts +76 -0
- package/types/lib/ecosystems/denoutils.d.ts.map +1 -0
- package/types/lib/ecosystems/dotnetutils.d.ts +45 -0
- package/types/lib/ecosystems/dotnetutils.d.ts.map +1 -0
- package/types/lib/ecosystems/ecosystems.d.ts +279 -0
- package/types/lib/ecosystems/ecosystems.d.ts.map +1 -0
- package/types/lib/ecosystems/golem.d.ts +60 -0
- package/types/lib/ecosystems/golem.d.ts.map +1 -0
- package/types/lib/ecosystems/gradleutils.d.ts +139 -0
- package/types/lib/ecosystems/gradleutils.d.ts.map +1 -0
- package/types/lib/ecosystems/jsEvidence.d.ts +17 -0
- package/types/lib/ecosystems/jsEvidence.d.ts.map +1 -0
- package/types/lib/ecosystems/npmutils.d.ts +183 -0
- package/types/lib/ecosystems/npmutils.d.ts.map +1 -0
- package/types/lib/ecosystems/parsers-bazel.d.ts +36 -0
- package/types/lib/ecosystems/parsers-bazel.d.ts.map +1 -0
- package/types/lib/ecosystems/parsers-dotnet.d.ts +116 -0
- package/types/lib/ecosystems/parsers-dotnet.d.ts.map +1 -0
- package/types/lib/ecosystems/parsers-gleam.d.ts +33 -0
- package/types/lib/ecosystems/parsers-gleam.d.ts.map +1 -0
- package/types/lib/ecosystems/parsers-go.d.ts +92 -0
- package/types/lib/ecosystems/parsers-go.d.ts.map +1 -0
- package/types/lib/ecosystems/parsers-js.d.ts +242 -0
- package/types/lib/ecosystems/parsers-js.d.ts.map +1 -0
- package/types/lib/ecosystems/parsers-jvm.d.ts +100 -0
- package/types/lib/ecosystems/parsers-jvm.d.ts.map +1 -0
- package/types/lib/ecosystems/parsers-misc.d.ts +450 -0
- package/types/lib/ecosystems/parsers-misc.d.ts.map +1 -0
- package/types/lib/ecosystems/parsers-python.d.ts +145 -0
- package/types/lib/ecosystems/parsers-python.d.ts.map +1 -0
- package/types/lib/ecosystems/parsers-rust.d.ts +56 -0
- package/types/lib/ecosystems/parsers-rust.d.ts.map +1 -0
- package/types/lib/ecosystems/parsers-zig.d.ts +83 -0
- package/types/lib/ecosystems/parsers-zig.d.ts.map +1 -0
- package/types/lib/ecosystems/pep770.d.ts +38 -0
- package/types/lib/ecosystems/pep770.d.ts.map +1 -0
- package/types/lib/ecosystems/pylockutils.d.ts +68 -0
- package/types/lib/ecosystems/pylockutils.d.ts.map +1 -0
- package/types/lib/ecosystems/pythonutils.d.ts +70 -0
- package/types/lib/ecosystems/pythonutils.d.ts.map +1 -0
- package/types/lib/ecosystems/registryProvenance.d.ts +26 -0
- package/types/lib/ecosystems/registryProvenance.d.ts.map +1 -0
- package/types/lib/ecosystems/remote/huggingface.d.ts +31 -0
- package/types/lib/ecosystems/remote/huggingface.d.ts.map +1 -0
- package/types/lib/ecosystems/rubyutils.d.ts +182 -0
- package/types/lib/ecosystems/rubyutils.d.ts.map +1 -0
- package/types/lib/ecosystems/rusi.d.ts +40 -0
- package/types/lib/ecosystems/rusi.d.ts.map +1 -0
- package/types/lib/ecosystems/sbtutils.d.ts +179 -0
- package/types/lib/ecosystems/sbtutils.d.ts.map +1 -0
- package/types/lib/ecosystems/tea.d.ts +180 -0
- package/types/lib/ecosystems/tea.d.ts.map +1 -0
- package/types/lib/ecosystems/utils.d.ts +41 -0
- package/types/lib/ecosystems/utils.d.ts.map +1 -0
- package/types/lib/ecosystems/zigResolver.d.ts +70 -0
- package/types/lib/ecosystems/zigResolver.d.ts.map +1 -0
- package/types/lib/evinser/db.d.ts +17 -0
- package/types/lib/evinser/db.d.ts.map +1 -0
- package/types/lib/evinser/evinser.d.ts +354 -0
- package/types/lib/evinser/evinser.d.ts.map +1 -0
- package/types/lib/evinser/scalasem.d.ts +15 -0
- package/types/lib/evinser/scalasem.d.ts.map +1 -0
- package/types/lib/evinser/swiftsem.d.ts +103 -0
- package/types/lib/evinser/swiftsem.d.ts.map +1 -0
- package/types/lib/helpers/annotationFormatter.d.ts +23 -0
- package/types/lib/helpers/annotationFormatter.d.ts.map +1 -0
- package/types/lib/helpers/bomSigner.d.ts +28 -0
- package/types/lib/helpers/bomSigner.d.ts.map +1 -0
- package/types/lib/helpers/exportUtils.d.ts +52 -0
- package/types/lib/helpers/exportUtils.d.ts.map +1 -0
- package/types/lib/helpers/remote/dependency-track.d.ts +23 -0
- package/types/lib/helpers/remote/dependency-track.d.ts.map +1 -0
- package/types/lib/helpers/versutils.d.ts +8 -0
- package/types/lib/helpers/versutils.d.ts.map +1 -0
- package/types/lib/helpers/vsixutils.d.ts +130 -0
- package/types/lib/helpers/vsixutils.d.ts.map +1 -0
- package/types/lib/inventory/agentFormulationParser.d.ts +21 -0
- package/types/lib/inventory/agentFormulationParser.d.ts.map +1 -0
- package/types/lib/inventory/aiCollector.d.ts +61 -0
- package/types/lib/inventory/aiCollector.d.ts.map +1 -0
- package/types/lib/inventory/aiInventory.d.ts +103 -0
- package/types/lib/inventory/aiInventory.d.ts.map +1 -0
- package/types/lib/inventory/aiModelVariants.d.ts +31 -0
- package/types/lib/inventory/aiModelVariants.d.ts.map +1 -0
- package/types/lib/inventory/aiOversightCollector.d.ts +28 -0
- package/types/lib/inventory/aiOversightCollector.d.ts.map +1 -0
- package/types/lib/inventory/aiProvenanceCollector.d.ts +13 -0
- package/types/lib/inventory/aiProvenanceCollector.d.ts.map +1 -0
- package/types/lib/inventory/analyzer.d.ts +157 -0
- package/types/lib/inventory/analyzer.d.ts.map +1 -0
- package/types/lib/inventory/analyzerScope.d.ts +106 -0
- package/types/lib/inventory/analyzerScope.d.ts.map +1 -0
- package/types/lib/inventory/astWorker.d.ts +9 -0
- package/types/lib/inventory/astWorker.d.ts.map +1 -0
- package/types/lib/inventory/atomUtils.d.ts +159 -0
- package/types/lib/inventory/atomUtils.d.ts.map +1 -0
- package/types/lib/inventory/auditCategories.d.ts +80 -0
- package/types/lib/inventory/auditCategories.d.ts.map +1 -0
- package/types/lib/inventory/bomUtils.d.ts +145 -0
- package/types/lib/inventory/bomUtils.d.ts.map +1 -0
- package/types/lib/inventory/cacheCommands.d.ts +28 -0
- package/types/lib/inventory/cacheCommands.d.ts.map +1 -0
- package/types/lib/inventory/cacheDir.d.ts +55 -0
- package/types/lib/inventory/cacheDir.d.ts.map +1 -0
- package/types/lib/inventory/cbomutils.d.ts +37 -0
- package/types/lib/inventory/cbomutils.d.ts.map +1 -0
- package/types/lib/inventory/cdxrs.d.ts +90 -0
- package/types/lib/inventory/cdxrs.d.ts.map +1 -0
- package/types/lib/inventory/ciParsers/azurePipelines.d.ts +27 -0
- package/types/lib/inventory/ciParsers/azurePipelines.d.ts.map +1 -0
- package/types/lib/inventory/ciParsers/circleCi.d.ts +27 -0
- package/types/lib/inventory/ciParsers/circleCi.d.ts.map +1 -0
- package/types/lib/inventory/ciParsers/common.d.ts +11 -0
- package/types/lib/inventory/ciParsers/common.d.ts.map +1 -0
- package/types/lib/inventory/ciParsers/githubActions.d.ts +38 -0
- package/types/lib/inventory/ciParsers/githubActions.d.ts.map +1 -0
- package/types/lib/inventory/ciParsers/gitlabCi.d.ts +26 -0
- package/types/lib/inventory/ciParsers/gitlabCi.d.ts.map +1 -0
- package/types/lib/inventory/ciParsers/jenkins.d.ts +26 -0
- package/types/lib/inventory/ciParsers/jenkins.d.ts.map +1 -0
- package/types/lib/inventory/citations.d.ts +90 -0
- package/types/lib/inventory/citations.d.ts.map +1 -0
- package/types/lib/inventory/communityAiConfigParser.d.ts +14 -0
- package/types/lib/inventory/communityAiConfigParser.d.ts.map +1 -0
- package/types/lib/inventory/containerRisk.d.ts +20 -0
- package/types/lib/inventory/containerRisk.d.ts.map +1 -0
- package/types/lib/inventory/cryptoAlgorithmFamily.d.ts +37 -0
- package/types/lib/inventory/cryptoAlgorithmFamily.d.ts.map +1 -0
- package/types/lib/inventory/deps.d.ts +140 -0
- package/types/lib/inventory/deps.d.ts.map +1 -0
- package/types/lib/inventory/depsUtils.d.ts +74 -0
- package/types/lib/inventory/depsUtils.d.ts.map +1 -0
- package/types/lib/inventory/display.d.ts +227 -0
- package/types/lib/inventory/display.d.ts.map +1 -0
- package/types/lib/inventory/dosai.d.ts +130 -0
- package/types/lib/inventory/dosai.d.ts.map +1 -0
- package/types/lib/inventory/dosaiParsers.d.ts +59 -0
- package/types/lib/inventory/dosaiParsers.d.ts.map +1 -0
- package/types/lib/inventory/dynamic.d.ts +25 -0
- package/types/lib/inventory/dynamic.d.ts.map +1 -0
- package/types/lib/inventory/envcontext.d.ts +377 -0
- package/types/lib/inventory/envcontext.d.ts.map +1 -0
- package/types/lib/inventory/evidenceUtils.d.ts +74 -0
- package/types/lib/inventory/evidenceUtils.d.ts.map +1 -0
- package/types/lib/inventory/fetchBatch.d.ts +127 -0
- package/types/lib/inventory/fetchBatch.d.ts.map +1 -0
- package/types/lib/inventory/fetchRate.d.ts +118 -0
- package/types/lib/inventory/fetchRate.d.ts.map +1 -0
- package/types/lib/inventory/forgeEnricher.d.ts +31 -0
- package/types/lib/inventory/forgeEnricher.d.ts.map +1 -0
- package/types/lib/inventory/formulationParsers.d.ts +50 -0
- package/types/lib/inventory/formulationParsers.d.ts.map +1 -0
- package/types/lib/inventory/gtfobins.d.ts +27 -0
- package/types/lib/inventory/gtfobins.d.ts.map +1 -0
- package/types/lib/inventory/hbom.d.ts +58 -0
- package/types/lib/inventory/hbom.d.ts.map +1 -0
- package/types/lib/inventory/hbomAnalysis.d.ts +56 -0
- package/types/lib/inventory/hbomAnalysis.d.ts.map +1 -0
- package/types/lib/inventory/hbomLoader.d.ts +7 -0
- package/types/lib/inventory/hbomLoader.d.ts.map +1 -0
- package/types/lib/inventory/hostTopology.d.ts +47 -0
- package/types/lib/inventory/hostTopology.d.ts.map +1 -0
- package/types/lib/inventory/inventoryStats.d.ts +42 -0
- package/types/lib/inventory/inventoryStats.d.ts.map +1 -0
- package/types/lib/inventory/jsonLike.d.ts +23 -0
- package/types/lib/inventory/jsonLike.d.ts.map +1 -0
- package/types/lib/inventory/licenseEnhancer.d.ts +70 -0
- package/types/lib/inventory/licenseEnhancer.d.ts.map +1 -0
- package/types/lib/inventory/lolbas.d.ts +16 -0
- package/types/lib/inventory/lolbas.d.ts.map +1 -0
- package/types/lib/inventory/mcp.d.ts +29 -0
- package/types/lib/inventory/mcp.d.ts.map +1 -0
- package/types/lib/inventory/mcpConfigParser.d.ts +20 -0
- package/types/lib/inventory/mcpConfigParser.d.ts.map +1 -0
- package/types/lib/inventory/mcpDiscovery.d.ts +33 -0
- package/types/lib/inventory/mcpDiscovery.d.ts.map +1 -0
- package/types/lib/inventory/mcpPinning.d.ts +11 -0
- package/types/lib/inventory/mcpPinning.d.ts.map +1 -0
- package/types/lib/inventory/osPackageResolver.d.ts +49 -0
- package/types/lib/inventory/osPackageResolver.d.ts.map +1 -0
- package/types/lib/inventory/osinfo.d.ts +120 -0
- package/types/lib/inventory/osinfo.d.ts.map +1 -0
- package/types/lib/inventory/osqueryTransform.d.ts +84 -0
- package/types/lib/inventory/osqueryTransform.d.ts.map +1 -0
- package/types/lib/inventory/plugins.d.ts +58 -0
- package/types/lib/inventory/plugins.d.ts.map +1 -0
- package/types/lib/inventory/protobom.d.ts +71 -0
- package/types/lib/inventory/protobom.d.ts.map +1 -0
- package/types/lib/inventory/protobomLoader.d.ts +17 -0
- package/types/lib/inventory/protobomLoader.d.ts.map +1 -0
- package/types/lib/inventory/provenanceUtils.d.ts +98 -0
- package/types/lib/inventory/provenanceUtils.d.ts.map +1 -0
- package/types/lib/inventory/purl.d.ts +313 -0
- package/types/lib/inventory/purl.d.ts.map +1 -0
- package/types/lib/inventory/rustFormulationParser.d.ts +17 -0
- package/types/lib/inventory/rustFormulationParser.d.ts.map +1 -0
- package/types/lib/inventory/sbomDocument.d.ts +59 -0
- package/types/lib/inventory/sbomDocument.d.ts.map +1 -0
- package/types/lib/inventory/source.d.ts +163 -0
- package/types/lib/inventory/source.d.ts.map +1 -0
- package/types/lib/inventory/spdx.d.ts +66 -0
- package/types/lib/inventory/spdx.d.ts.map +1 -0
- package/types/lib/inventory/spdxExpression.d.ts +58 -0
- package/types/lib/inventory/spdxExpression.d.ts.map +1 -0
- package/types/lib/inventory/spdxUtils.d.ts +12 -0
- package/types/lib/inventory/spdxUtils.d.ts.map +1 -0
- package/types/lib/inventory/table.d.ts +19 -0
- package/types/lib/inventory/table.d.ts.map +1 -0
- package/types/lib/inventory/traceRunner.d.ts +80 -0
- package/types/lib/inventory/traceRunner.d.ts.map +1 -0
- package/types/lib/inventory/unicodeScan.d.ts +46 -0
- package/types/lib/inventory/unicodeScan.d.ts.map +1 -0
- package/types/lib/managers/binary.d.ts +76 -0
- package/types/lib/managers/binary.d.ts.map +1 -0
- package/types/lib/managers/containerutils.d.ts +30 -0
- package/types/lib/managers/containerutils.d.ts.map +1 -0
- package/types/lib/managers/docker.d.ts +157 -0
- package/types/lib/managers/docker.d.ts.map +1 -0
- package/types/lib/managers/dockerConnection.d.ts +42 -0
- package/types/lib/managers/dockerConnection.d.ts.map +1 -0
- package/types/lib/managers/oci.d.ts +21 -0
- package/types/lib/managers/oci.d.ts.map +1 -0
- package/types/lib/managers/piptree.d.ts +13 -0
- package/types/lib/managers/piptree.d.ts.map +1 -0
- package/types/lib/parsers/cmakeCache.d.ts +70 -0
- package/types/lib/parsers/cmakeCache.d.ts.map +1 -0
- package/types/lib/parsers/gguf.d.ts +39 -0
- package/types/lib/parsers/gguf.d.ts.map +1 -0
- package/types/lib/parsers/gitAiNotes.d.ts +15 -0
- package/types/lib/parsers/gitAiNotes.d.ts.map +1 -0
- package/types/lib/parsers/gitmodules.d.ts +88 -0
- package/types/lib/parsers/gitmodules.d.ts.map +1 -0
- package/types/lib/parsers/htmlExtract.d.ts +34 -0
- package/types/lib/parsers/htmlExtract.d.ts.map +1 -0
- package/types/lib/parsers/huggingfaceManifest.d.ts +153 -0
- package/types/lib/parsers/huggingfaceManifest.d.ts.map +1 -0
- package/types/lib/parsers/huggingfaceUtils.d.ts +155 -0
- package/types/lib/parsers/huggingfaceUtils.d.ts.map +1 -0
- package/types/lib/parsers/iri.d.ts +68 -0
- package/types/lib/parsers/iri.d.ts.map +1 -0
- package/types/lib/parsers/npmrc.d.ts +33 -0
- package/types/lib/parsers/npmrc.d.ts.map +1 -0
- package/types/lib/parsers/ollama.d.ts +22 -0
- package/types/lib/parsers/ollama.d.ts.map +1 -0
- package/types/lib/parsers/xml.d.ts +47 -0
- package/types/lib/parsers/xml.d.ts.map +1 -0
- package/types/lib/server/server.d.ts +51 -0
- package/types/lib/server/server.d.ts.map +1 -0
- package/types/lib/stages/postgen/annotator.d.ts +36 -0
- package/types/lib/stages/postgen/annotator.d.ts.map +1 -0
- package/types/lib/stages/postgen/auditBom.d.ts +92 -0
- package/types/lib/stages/postgen/auditBom.d.ts.map +1 -0
- package/types/lib/stages/postgen/postgen.d.ts +59 -0
- package/types/lib/stages/postgen/postgen.d.ts.map +1 -0
- package/types/lib/stages/postgen/ruleEngine.d.ts +18 -0
- package/types/lib/stages/postgen/ruleEngine.d.ts.map +1 -0
- package/types/lib/stages/postgen/sortBom.d.ts +34 -0
- package/types/lib/stages/postgen/sortBom.d.ts.map +1 -0
- package/types/lib/stages/postgen/spdxConverter.d.ts +11 -0
- package/types/lib/stages/postgen/spdxConverter.d.ts.map +1 -0
- package/types/lib/stages/postgen/specVersionCompat.d.ts +71 -0
- package/types/lib/stages/postgen/specVersionCompat.d.ts.map +1 -0
- package/types/lib/stages/pregen/envAudit.d.ts +14 -0
- package/types/lib/stages/pregen/envAudit.d.ts.map +1 -0
- package/types/lib/stages/pregen/pregen.d.ts +59 -0
- package/types/lib/stages/pregen/pregen.d.ts.map +1 -0
- package/types/lib/third-party/arborist/lib/arborist/index.d.ts +47 -0
- package/types/lib/third-party/arborist/lib/arborist/index.d.ts.map +1 -0
- package/types/lib/third-party/arborist/lib/arborist/load-actual.d.ts +4 -0
- package/types/lib/third-party/arborist/lib/arborist/load-actual.d.ts.map +1 -0
- package/types/lib/third-party/arborist/lib/arborist/load-virtual.d.ts +4 -0
- package/types/lib/third-party/arborist/lib/arborist/load-virtual.d.ts.map +1 -0
- package/types/lib/third-party/arborist/lib/bin-links.d.ts +18 -0
- package/types/lib/third-party/arborist/lib/bin-links.d.ts.map +1 -0
- package/types/lib/third-party/arborist/lib/calc-dep-flags.d.ts +3 -0
- package/types/lib/third-party/arborist/lib/calc-dep-flags.d.ts.map +1 -0
- package/types/lib/third-party/arborist/lib/case-insensitive-map.d.ts +9 -0
- package/types/lib/third-party/arborist/lib/case-insensitive-map.d.ts.map +1 -0
- package/types/lib/third-party/arborist/lib/consistent-resolve.d.ts +3 -0
- package/types/lib/third-party/arborist/lib/consistent-resolve.d.ts.map +1 -0
- package/types/lib/third-party/arborist/lib/debug.d.ts +3 -0
- package/types/lib/third-party/arborist/lib/debug.d.ts.map +1 -0
- package/types/lib/third-party/arborist/lib/dep-valid.d.ts +3 -0
- package/types/lib/third-party/arborist/lib/dep-valid.d.ts.map +1 -0
- package/types/lib/third-party/arborist/lib/edge.d.ts +46 -0
- package/types/lib/third-party/arborist/lib/edge.d.ts.map +1 -0
- package/types/lib/third-party/arborist/lib/from-path.d.ts +3 -0
- package/types/lib/third-party/arborist/lib/from-path.d.ts.map +1 -0
- package/types/lib/third-party/arborist/lib/gather-dep-set.d.ts +3 -0
- package/types/lib/third-party/arborist/lib/gather-dep-set.d.ts.map +1 -0
- package/types/lib/third-party/arborist/lib/index.d.ts +3 -0
- package/types/lib/third-party/arborist/lib/index.d.ts.map +1 -0
- package/types/lib/third-party/arborist/lib/inventory.d.ts +14 -0
- package/types/lib/third-party/arborist/lib/inventory.d.ts.map +1 -0
- package/types/lib/third-party/arborist/lib/link.d.ts +18 -0
- package/types/lib/third-party/arborist/lib/link.d.ts.map +1 -0
- package/types/lib/third-party/arborist/lib/node.d.ts +112 -0
- package/types/lib/third-party/arborist/lib/node.d.ts.map +1 -0
- package/types/lib/third-party/arborist/lib/npm-extension.d.ts +18 -0
- package/types/lib/third-party/arborist/lib/npm-extension.d.ts.map +1 -0
- package/types/lib/third-party/arborist/lib/override-resolves.d.ts +3 -0
- package/types/lib/third-party/arborist/lib/override-resolves.d.ts.map +1 -0
- package/types/lib/third-party/arborist/lib/override-set.d.ts +27 -0
- package/types/lib/third-party/arborist/lib/override-set.d.ts.map +1 -0
- package/types/lib/third-party/arborist/lib/package-extensions.d.ts +36 -0
- package/types/lib/third-party/arborist/lib/package-extensions.d.ts.map +1 -0
- package/types/lib/third-party/arborist/lib/printable.d.ts +3 -0
- package/types/lib/third-party/arborist/lib/printable.d.ts.map +1 -0
- package/types/lib/third-party/arborist/lib/proc-log.d.ts +20 -0
- package/types/lib/third-party/arborist/lib/proc-log.d.ts.map +1 -0
- package/types/lib/third-party/arborist/lib/realpath.d.ts +3 -0
- package/types/lib/third-party/arborist/lib/realpath.d.ts.map +1 -0
- package/types/lib/third-party/arborist/lib/relpath.d.ts +3 -0
- package/types/lib/third-party/arborist/lib/relpath.d.ts.map +1 -0
- package/types/lib/third-party/arborist/lib/shrinkwrap.d.ts +54 -0
- package/types/lib/third-party/arborist/lib/shrinkwrap.d.ts.map +1 -0
- package/types/lib/third-party/arborist/lib/spec-from-lock.d.ts +3 -0
- package/types/lib/third-party/arborist/lib/spec-from-lock.d.ts.map +1 -0
- package/types/lib/third-party/arborist/lib/tree-check.d.ts +3 -0
- package/types/lib/third-party/arborist/lib/tree-check.d.ts.map +1 -0
- package/types/lib/third-party/arborist/lib/validate-npm-package-name.d.ts +13 -0
- package/types/lib/third-party/arborist/lib/validate-npm-package-name.d.ts.map +1 -0
- package/types/lib/third-party/arborist/lib/version-from-tgz.d.ts +6 -0
- package/types/lib/third-party/arborist/lib/version-from-tgz.d.ts.map +1 -0
- package/types/lib/third-party/arborist/lib/yarn-lock.d.ts +35 -0
- package/types/lib/third-party/arborist/lib/yarn-lock.d.ts.map +1 -0
- package/types/lib/validator/bomValidator.d.ts +40 -0
- package/types/lib/validator/bomValidator.d.ts.map +1 -0
- package/types/lib/validator/complianceEngine.d.ts +72 -0
- package/types/lib/validator/complianceEngine.d.ts.map +1 -0
- package/types/lib/validator/complianceRules.d.ts +61 -0
- package/types/lib/validator/complianceRules.d.ts.map +1 -0
- package/types/lib/validator/index.d.ts +101 -0
- package/types/lib/validator/index.d.ts.map +1 -0
- package/types/lib/validator/reporters/annotations.d.ts +37 -0
- package/types/lib/validator/reporters/annotations.d.ts.map +1 -0
- package/types/lib/validator/reporters/console.d.ts +34 -0
- package/types/lib/validator/reporters/console.d.ts.map +1 -0
- package/types/lib/validator/reporters/index.d.ts +30 -0
- package/types/lib/validator/reporters/index.d.ts.map +1 -0
- package/types/lib/validator/reporters/json.d.ts +11 -0
- package/types/lib/validator/reporters/json.d.ts.map +1 -0
- package/types/lib/validator/reporters/sarif.d.ts +22 -0
- package/types/lib/validator/reporters/sarif.d.ts.map +1 -0
- package/mod.d.ts +0 -7
- package/mod.js +0 -22
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
/** True when running under Node.js. */
|
|
2
|
+
export declare const isNode: boolean;
|
|
3
|
+
/** True when running under Bun. */
|
|
4
|
+
export declare const isBun: boolean;
|
|
5
|
+
/** True when running under Deno. */
|
|
6
|
+
export declare const isDeno: boolean;
|
|
7
|
+
/** Value of the CDXGEN_SPDX_CREATED_BY environment variable, or undefined when unset. */
|
|
8
|
+
export declare const CDXGEN_SPDX_CREATED_BY: string | undefined;
|
|
9
|
+
/**
|
|
10
|
+
* Resolved table border style for console output ("ascii", "unicode", or
|
|
11
|
+
* "auto"), driven by the CDXGEN_TABLE_BORDER environment variable.
|
|
12
|
+
*/
|
|
13
|
+
export declare const TABLE_BORDER_STYLE: string;
|
|
14
|
+
/** True when test scope dependencies should be included for Maven projects (default true unless CDX_MAVEN_INCLUDE_TEST_SCOPE is explicitly false). */
|
|
15
|
+
export declare const includeMavenTestScope: boolean;
|
|
16
|
+
/** True when the native Maven dependency tree command should be preferred (default true unless PREFER_MAVEN_DEPS_TREE is false/0). */
|
|
17
|
+
export declare const PREFER_MAVEN_DEPS_TREE: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Split a Maven arguments string into an argv array, honoring shell quoting
|
|
20
|
+
* (single and double quotes) and backslash escaping of whitespace and quotes.
|
|
21
|
+
*
|
|
22
|
+
* @param {string} argsString Raw Maven arguments string.
|
|
23
|
+
* @returns {string[]} Parsed argument array, or an empty array when input is falsy.
|
|
24
|
+
*/
|
|
25
|
+
export declare function parseMavenArgs(argsString: string): string[];
|
|
26
|
+
/**
|
|
27
|
+
* Determines whether license information should be fetched from remote sources,
|
|
28
|
+
* based on the FETCH_LICENSE environment variable.
|
|
29
|
+
*
|
|
30
|
+
* @returns {boolean} True if the FETCH_LICENSE env var is set to "true" or "1"
|
|
31
|
+
*/
|
|
32
|
+
export declare function shouldFetchLicense(): boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Determines whether remote package metadata should be fetched for enrichment.
|
|
35
|
+
*
|
|
36
|
+
* @returns {boolean} True when registry metadata enrichment is enabled.
|
|
37
|
+
*/
|
|
38
|
+
export declare function shouldFetchPackageMetadata(): boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Determines whether VCS (version control system) information should be fetched
|
|
41
|
+
* for Go packages, based on the GO_FETCH_VCS environment variable.
|
|
42
|
+
*
|
|
43
|
+
* @returns {boolean} True if the GO_FETCH_VCS env var is set to "true" or "1"
|
|
44
|
+
*/
|
|
45
|
+
export declare function shouldFetchVCS(): boolean;
|
|
46
|
+
/** True when license information should be fetched from remote sources (FETCH_LICENSE env var). */
|
|
47
|
+
export declare const FETCH_LICENSE: boolean;
|
|
48
|
+
/** True when search.maven.org should be used to identify jars without Maven metadata (default true unless SEARCH_MAVEN_ORG is explicitly false). */
|
|
49
|
+
export declare const SEARCH_MAVEN_ORG: boolean;
|
|
50
|
+
/** Resolved Java executable command (JAVA_CMD env var > JAVA_HOME/bin/java > "java"). */
|
|
51
|
+
export declare const JAVA_CMD: string;
|
|
52
|
+
/**
|
|
53
|
+
* Returns the Java executable command to use, resolved in priority order:
|
|
54
|
+
* JAVA_CMD env var > JAVA_HOME/bin/java > "java".
|
|
55
|
+
*
|
|
56
|
+
* @returns {string} Path or name of the Java executable
|
|
57
|
+
*/
|
|
58
|
+
export declare function getJavaCommand(): string;
|
|
59
|
+
/** Resolved Python executable command (PYTHON_CMD env var > CONDA_PYTHON_EXE > "python"). */
|
|
60
|
+
export declare const PYTHON_CMD: string;
|
|
61
|
+
/**
|
|
62
|
+
* Returns the Python executable command to use, resolved in priority order:
|
|
63
|
+
* PYTHON_CMD env var > CONDA_PYTHON_EXE env var > "python".
|
|
64
|
+
*
|
|
65
|
+
* @returns {string} Path or name of the Python executable
|
|
66
|
+
*/
|
|
67
|
+
export declare function getPythonCommand(): string;
|
|
68
|
+
/** Resolved .NET CLI command (DOTNET_CMD env var, or "dotnet"). */
|
|
69
|
+
export declare let DOTNET_CMD: string;
|
|
70
|
+
/** Resolved Node.js executable command (NODE_CMD env var, or "node"). */
|
|
71
|
+
export declare let NODE_CMD: string;
|
|
72
|
+
/** Resolved npm executable command (NPM_CMD env var, or "npm"). */
|
|
73
|
+
export declare let NPM_CMD: string;
|
|
74
|
+
/** Resolved Yarn executable command (YARN_CMD env var, or "yarn"). */
|
|
75
|
+
export declare let YARN_CMD: string;
|
|
76
|
+
/** Resolved GCC executable command (GCC_CMD env var, or "gcc"). */
|
|
77
|
+
export declare let GCC_CMD: string;
|
|
78
|
+
/** Resolved rustc executable command (RUSTC_CMD env var, or "rustc"). */
|
|
79
|
+
export declare let RUSTC_CMD: string;
|
|
80
|
+
/** Resolved Go executable command (GO_CMD env var, or "go"). */
|
|
81
|
+
export declare let GO_CMD: string;
|
|
82
|
+
/** Resolved Cargo executable command (CARGO_CMD env var, or "cargo"). */
|
|
83
|
+
export declare let CARGO_CMD: string;
|
|
84
|
+
/** Resolved Clojure CLI executable command (CLJ_CMD env var, or "clj"). */
|
|
85
|
+
export declare let CLJ_CMD: string;
|
|
86
|
+
/** Resolved Leiningen executable command (LEIN_CMD env var, or "lein"). */
|
|
87
|
+
export declare let LEIN_CMD: string;
|
|
88
|
+
/** Resolved temp directory used by cdxgen (CDXGEN_TEMP_DIR env var, or "temp"). */
|
|
89
|
+
export declare let CDXGEN_TEMP_DIR: string;
|
|
90
|
+
/** Resolved Swift executable command (SWIFT_CMD env var, or "swift"). */
|
|
91
|
+
export declare const SWIFT_CMD: string;
|
|
92
|
+
/** Resolved Ruby executable command (RUBY_CMD env var, or "ruby"). */
|
|
93
|
+
export declare const RUBY_CMD: string;
|
|
94
|
+
/** Python package components that can be excluded from the generated BOM. */
|
|
95
|
+
export declare const PYTHON_EXCLUDED_COMPONENTS: string[];
|
|
96
|
+
/** Map of base cdxgen project type to the array of accepted alias strings. */
|
|
97
|
+
export declare const PROJECT_TYPE_ALIASES: {
|
|
98
|
+
java: string[];
|
|
99
|
+
android: string[];
|
|
100
|
+
jar: string[];
|
|
101
|
+
"gradle-index": string[];
|
|
102
|
+
"sbt-index": string[];
|
|
103
|
+
"maven-index": string[];
|
|
104
|
+
"cargo-cache": string[];
|
|
105
|
+
js: string[];
|
|
106
|
+
mcp: string[];
|
|
107
|
+
"ai-skill": string[];
|
|
108
|
+
py: string[];
|
|
109
|
+
go: string[];
|
|
110
|
+
rust: string[];
|
|
111
|
+
php: string[];
|
|
112
|
+
ruby: string[];
|
|
113
|
+
csharp: string[];
|
|
114
|
+
dart: string[];
|
|
115
|
+
haskell: string[];
|
|
116
|
+
elixir: string[];
|
|
117
|
+
c: string[];
|
|
118
|
+
clojure: string[];
|
|
119
|
+
github: string[];
|
|
120
|
+
hbom: string[];
|
|
121
|
+
os: string[];
|
|
122
|
+
jenkins: string[];
|
|
123
|
+
helm: string[];
|
|
124
|
+
"helm-index": string[];
|
|
125
|
+
universal: string[];
|
|
126
|
+
cloudbuild: string[];
|
|
127
|
+
swift: string[];
|
|
128
|
+
binary: string[];
|
|
129
|
+
oci: string[];
|
|
130
|
+
cocoa: string[];
|
|
131
|
+
scala: string[];
|
|
132
|
+
nix: string[];
|
|
133
|
+
zig: string[];
|
|
134
|
+
gleam: string[];
|
|
135
|
+
caxa: string[];
|
|
136
|
+
asar: string[];
|
|
137
|
+
"vscode-extension": string[];
|
|
138
|
+
"chrome-extension": string[];
|
|
139
|
+
dynamic: string[];
|
|
140
|
+
"ai-provenance": string[];
|
|
141
|
+
};
|
|
142
|
+
/** Map of base package manager to the array of accepted alias strings. */
|
|
143
|
+
export declare const PACKAGE_MANAGER_ALIASES: {
|
|
144
|
+
scala: string[];
|
|
145
|
+
};
|
|
146
|
+
/**
|
|
147
|
+
* Method to check if a given feature flag is enabled.
|
|
148
|
+
*
|
|
149
|
+
* @param {Object} cliOptions CLI options
|
|
150
|
+
* @param {String} feature Feature flag
|
|
151
|
+
*
|
|
152
|
+
* @returns {Boolean} True if the feature is enabled
|
|
153
|
+
*/
|
|
154
|
+
export declare function isFeatureEnabled(cliOptions: Object, feature: string): boolean;
|
|
155
|
+
/**
|
|
156
|
+
* Method to check if the given project types are allowed by checking against include and exclude types passed from the CLI arguments.
|
|
157
|
+
*
|
|
158
|
+
* @param {Array} projectTypes project types to check
|
|
159
|
+
* @param {Object} options CLI options
|
|
160
|
+
* @param {Boolean} defaultStatus Default return value if there are no types provided
|
|
161
|
+
*/
|
|
162
|
+
export declare function hasAnyProjectType(projectTypes: any[], options: Object, defaultStatus?: boolean): any;
|
|
163
|
+
/**
|
|
164
|
+
* Determine whether the predictive dependency audit should run for the current
|
|
165
|
+
* CLI invocation.
|
|
166
|
+
*
|
|
167
|
+
* OBOM-focused runs (`obom` or explicit `-t os` / OS aliases only) should keep
|
|
168
|
+
* the direct BOM audit findings but skip the predictive dependency audit.
|
|
169
|
+
*
|
|
170
|
+
* @param {object} options CLI options
|
|
171
|
+
* @param {string} [commandPath] Invoked command path or name
|
|
172
|
+
* @returns {boolean} True when predictive dependency audit should run
|
|
173
|
+
*/
|
|
174
|
+
export declare function shouldRunPredictiveBomAudit(options: object, commandPath?: string): boolean;
|
|
175
|
+
/**
|
|
176
|
+
* Convenient method to check if the given package manager is allowed.
|
|
177
|
+
*
|
|
178
|
+
* @param {String} name Package manager name
|
|
179
|
+
* @param {Array} conflictingManagers List of package managers
|
|
180
|
+
* @param {Object} options CLI options
|
|
181
|
+
*
|
|
182
|
+
* @returns {Boolean} True if the package manager is allowed
|
|
183
|
+
*/
|
|
184
|
+
export declare function isPackageManagerAllowed(name: string, conflictingManagers: any[], options: Object): boolean;
|
|
185
|
+
/**
|
|
186
|
+
* Function to parse a list of environment variables to identify the paths containing executable binaries
|
|
187
|
+
*
|
|
188
|
+
* @param envValues {Array[String]} Environment variables list
|
|
189
|
+
* @returns {Array[String]} Binary Paths identified from the environment variables
|
|
190
|
+
*/
|
|
191
|
+
export declare function extractPathEnv(envValues: any): any;
|
|
192
|
+
//# sourceMappingURL=env.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../../../lib/core/env.js"],"names":[],"mappings":"AAUA,uCAAuC;AACvC,eAAO,MAAM,MAAM,SAAmD,CAAC;AACvE,mCAAmC;AACnC,eAAO,MAAM,KAAK,SAAwC,CAAC;AAC3D,oCAAoC;AACpC,eAAO,MAAM,MAAM,SAA+C,CAAC;AAEnE,yFAAyF;AACzF,eAAO,MAAM,sBAAsB,oBAElC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,kBAAkB,QAIrB,CAAC;AAEX,sJAAsJ;AACtJ,eAAO,MAAM,qBAAqB,SAI/B,CAAC;AAEJ,sIAAsI;AACtI,eAAO,MAAM,sBAAsB,SAElC,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,UAAU,EAH9B,MAG8B,GAF5B,MAAM,EAAE,CAiDpB;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,IAFrB,OAAO,CAOnB;AAED;;;;GAIG;AACH,wBAAgB,0BAA0B,IAF7B,OAAO,CAUnB;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,IAFjB,OAAO,CAOnB;AAED,mGAAmG;AACnG,eAAO,MAAM,aAAa,SAAuB,CAAC;AAElD,oJAAoJ;AACpJ,eAAO,MAAM,gBAAgB,SAEwC,CAAC;AAEtE,yFAAyF;AACzF,eAAO,MAAM,QAAQ,QAAmB,CAAC;AAEzC;;;;;GAKG;AACH,wBAAgB,cAAc,IAFjB,MAAM,CAclB;AAED,6FAA6F;AAC7F,eAAO,MAAM,UAAU,QAAqB,CAAC;AAE7C;;;;;GAKG;AACH,wBAAgB,gBAAgB,IAFnB,MAAM,CAUlB;AAED,mEAAmE;AACnE,eAAO,IAAI,UAAU,QAAW,CAAC;AAIjC,yEAAyE;AACzE,eAAO,IAAI,QAAQ,QAAS,CAAC;AAI7B,mEAAmE;AACnE,eAAO,IAAI,OAAO,QAAQ,CAAC;AAI3B,sEAAsE;AACtE,eAAO,IAAI,QAAQ,QAAS,CAAC;AAI7B,mEAAmE;AACnE,eAAO,IAAI,OAAO,QAAQ,CAAC;AAI3B,yEAAyE;AACzE,eAAO,IAAI,SAAS,QAAU,CAAC;AAI/B,gEAAgE;AAChE,eAAO,IAAI,MAAM,QAAO,CAAC;AAIzB,yEAAyE;AACzE,eAAO,IAAI,SAAS,QAAU,CAAC;AAK/B,2EAA2E;AAC3E,eAAO,IAAI,OAAO,QAAQ,CAAC;AAK3B,2EAA2E;AAC3E,eAAO,IAAI,QAAQ,QAAS,CAAC;AAK7B,mFAAmF;AACnF,eAAO,IAAI,eAAe,QAAS,CAAC;AAKpC,yEAAyE;AACzE,eAAO,MAAM,SAAS,QAAkD,CAAC;AAEzE,sEAAsE;AACtE,eAAO,MAAM,QAAQ,QAAgD,CAAC;AAEtE,6EAA6E;AAC7E,eAAO,MAAM,0BAA0B,UAWtC,CAAC;AAEF,8EAA8E;AAC9E,eAAO,MAAM,oBAAoB;IAC/B,IAAI;IAwBJ,OAAO;IACP,GAAG;IACH,cAAc;IACd,WAAW;IACX,aAAa;IACb,aAAa;IACb,EAAE;IAiCF,GAAG;IACH,UAAU;IACV,EAAE;IAuBF,EAAE;IACF,IAAI;IACJ,GAAG;IACH,IAAI;IACJ,MAAM;IA4BN,IAAI;IACJ,OAAO;IACP,MAAM;IACN,CAAC;IACD,OAAO;IACP,MAAM;IACN,IAAI;IACJ,EAAE;IACF,OAAO;IACP,IAAI;IACJ,YAAY;IACZ,SAAS;IAcT,UAAU;IACV,KAAK;IAUL,MAAM;IACN,GAAG;IACH,KAAK;IACL,KAAK;IACL,GAAG;IACH,GAAG;IACH,KAAK;IACL,IAAI;IACJ,IAAI;IACJ,kBAAkB;IASlB,kBAAkB;IAMlB,OAAO;IACP,eAAe;CAChB,CAAC;AAEF,0EAA0E;AAC1E,eAAO,MAAM,uBAAuB;IAClC,KAAK;CACN,CAAC;AAEF;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,UAAU,EALhC,MAKgC,EAAE,OAAO,QAAA,WAiBnD;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,YAAY,OAAA,EAAE,OAAO,EAH5C,MAG4C,EAAE,aAAa,UAAO,OAmG5E;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,2BAA2B,CAAC,OAAO,EAJxC,MAIwC,EAAE,WAAW,AAH7D,CACA,EADQ,MAGqD,GAFnD,OAAO,CAiCnB;AAED;;;;;;;;GAQG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,QAAA,EAAE,mBAAmB,OAAA,EAAE,OAAO,EAJ/D,MAI+D,WAezE;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,SAAS,KAAA,OA8CvC"}
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import { Buffer } from "node:buffer";
|
|
2
|
+
/**
|
|
3
|
+
* Safely check if a file path exists without crashing due to a lack of permissions
|
|
4
|
+
*
|
|
5
|
+
* @param {String} filePath File path
|
|
6
|
+
* @Boolean True if the path exists. False otherwise
|
|
7
|
+
*/
|
|
8
|
+
export declare function safeExistsSync(filePath: string): any;
|
|
9
|
+
/**
|
|
10
|
+
* Permission- and dry-run-aware wrapper around writeFileSync. Records the
|
|
11
|
+
* activity and returns undefined when blocked.
|
|
12
|
+
*
|
|
13
|
+
* @param {string} filePath File path to write.
|
|
14
|
+
* @param {string|Buffer} data Data to write.
|
|
15
|
+
* @param {Object} [options] writeFileSync options (encoding, mode, flag).
|
|
16
|
+
* @returns {void}
|
|
17
|
+
*/
|
|
18
|
+
export declare function safeWriteSync(filePath: string, data: string | Buffer, options?: Object): void;
|
|
19
|
+
/**
|
|
20
|
+
* Safely create a directory without crashing due to a lack of permissions
|
|
21
|
+
*
|
|
22
|
+
* @param {String} filePath File path
|
|
23
|
+
* @param options {Options} mkdir options
|
|
24
|
+
* @Boolean True if the path exists. False otherwise
|
|
25
|
+
*/
|
|
26
|
+
export declare function safeMkdirSync(filePath: string, options: Options): undefined;
|
|
27
|
+
/**
|
|
28
|
+
* Dry-run-aware wrapper around mkdtempSync that records the activity. In dry-run
|
|
29
|
+
* mode, returns a synthetic path without touching the filesystem.
|
|
30
|
+
*
|
|
31
|
+
* @param {string} prefix Path prefix for the temporary directory.
|
|
32
|
+
* @param {string|Object} [options] Encoding or mkdtempSync options.
|
|
33
|
+
* @returns {string|undefined} The created directory path, a synthetic path in dry-run mode, or undefined when blocked.
|
|
34
|
+
*/
|
|
35
|
+
export declare function safeMkdtempSync(prefix: string, options?: string | Object): string | undefined;
|
|
36
|
+
/**
|
|
37
|
+
* Dry-run-aware wrapper around rmSync. Records the activity and returns
|
|
38
|
+
* undefined when blocked.
|
|
39
|
+
*
|
|
40
|
+
* @param {string} filePath Path to remove.
|
|
41
|
+
* @param {Object} [options] rmSync options (recursive, force, etc.).
|
|
42
|
+
* @returns {void}
|
|
43
|
+
*/
|
|
44
|
+
export declare function safeRmSync(filePath: string, options?: Object): void;
|
|
45
|
+
/**
|
|
46
|
+
* Dry-run-aware wrapper around unlinkSync. Records the activity and returns
|
|
47
|
+
* undefined when blocked.
|
|
48
|
+
*
|
|
49
|
+
* @param {string} filePath File path to unlink.
|
|
50
|
+
* @returns {void}
|
|
51
|
+
*/
|
|
52
|
+
export declare function safeUnlinkSync(filePath: string): void;
|
|
53
|
+
/**
|
|
54
|
+
* Dry-run-aware wrapper around copyFileSync. Records the activity and returns
|
|
55
|
+
* undefined when blocked.
|
|
56
|
+
*
|
|
57
|
+
* @param {string} src Source file path.
|
|
58
|
+
* @param {string} dest Destination file path.
|
|
59
|
+
* @param {number} [mode] Optional copy mode bitmask.
|
|
60
|
+
* @returns {void}
|
|
61
|
+
*/
|
|
62
|
+
export declare function safeCopyFileSync(src: string, dest: string, mode?: number): void;
|
|
63
|
+
/**
|
|
64
|
+
* Run an archive extractor under dry-run/debug activity tracing. In dry-run
|
|
65
|
+
* mode the extraction is recorded as blocked and resolves false without running.
|
|
66
|
+
*
|
|
67
|
+
* @param {string} sourcePath Path to the source archive.
|
|
68
|
+
* @param {string} targetPath Path to extract into.
|
|
69
|
+
* @param {() => Promise} extractor Async function performing the extraction.
|
|
70
|
+
* @param {string} [kind="unzip"] Archive kind label for tracing.
|
|
71
|
+
* @param {Object} [options] Optional tracing metadata, blockedReason, and failureReason.
|
|
72
|
+
* @returns {Promise<boolean>} True when extraction succeeded, false when blocked by dry-run.
|
|
73
|
+
*/
|
|
74
|
+
export declare function safeExtractArchive(sourcePath: string, targetPath: string, extractor: () => Promise<any>, kind?: string, options?: Object): Promise<boolean>;
|
|
75
|
+
/** Set of temporary file paths written by cdxgen that are removed on process exit. */
|
|
76
|
+
export declare const temporaryFiles: Set<any>;
|
|
77
|
+
/** Set accumulating every executable command spawned via safeSpawnSync. */
|
|
78
|
+
export declare const commandsExecuted: Set<any>;
|
|
79
|
+
/**
|
|
80
|
+
* Safe wrapper around spawnSync that enforces permission checks, injects default
|
|
81
|
+
* options (maxBuffer, encoding, timeout), warns about unsafe Python and pip/uv
|
|
82
|
+
* invocations, and records every executed command in the commandsExecuted set.
|
|
83
|
+
*
|
|
84
|
+
* @param {string} command The executable to spawn
|
|
85
|
+
* @param {string[]} args Arguments to pass to the command
|
|
86
|
+
* @param {Object} options Options forwarded to spawnSync (e.g. cwd, env, shell)
|
|
87
|
+
* @returns {Object} spawnSync result object with status, stdout, stderr, and error fields
|
|
88
|
+
*/
|
|
89
|
+
export declare function safeSpawnSync(command: string, args: string[], options: Object): Object;
|
|
90
|
+
/** Default spawn timeout in milliseconds (20 minutes), overridable via CDXGEN_TIMEOUT_MS. */
|
|
91
|
+
export declare const TIMEOUT_MS: number;
|
|
92
|
+
/** Default maxBuffer size for spawned process stdout/stderr (100 MB), overridable via CDXGEN_MAX_BUFFER. */
|
|
93
|
+
export declare const MAX_BUFFER: number;
|
|
94
|
+
/**
|
|
95
|
+
* Method to get files matching a pattern
|
|
96
|
+
*
|
|
97
|
+
* @param {string} dirPath Root directory for search
|
|
98
|
+
* @param {string} pattern Glob pattern (eg: *.gradle)
|
|
99
|
+
* @param {Object} options CLI options
|
|
100
|
+
*
|
|
101
|
+
* @returns {Array[string]} List of matched files
|
|
102
|
+
*/
|
|
103
|
+
export declare function getAllFiles(dirPath: string, pattern: string, options?: Object): any;
|
|
104
|
+
/**
|
|
105
|
+
* Confine directory-walk caching to one subtree, or switch it off.
|
|
106
|
+
*
|
|
107
|
+
* @param {string|undefined} rootDir Subtree whose contents are fixed for the rest of the scan
|
|
108
|
+
*/
|
|
109
|
+
export declare function setDirWalkCacheRoot(rootDir: string | undefined): void;
|
|
110
|
+
/**
|
|
111
|
+
* Release every cached directory walk.
|
|
112
|
+
*
|
|
113
|
+
* Called when a BOM generation cycle starts, so that a long-lived process such
|
|
114
|
+
* as the server never serves a scan from an earlier scan's view of the
|
|
115
|
+
* filesystem, and so the retained directory entries are freed.
|
|
116
|
+
*/
|
|
117
|
+
export declare function clearFileDiscoveryCache(): void;
|
|
118
|
+
/**
|
|
119
|
+
* Method to get files matching a pattern
|
|
120
|
+
*
|
|
121
|
+
* @param {string} dirPath Root directory for search
|
|
122
|
+
* @param {string} pattern Glob pattern (eg: *.gradle)
|
|
123
|
+
* @param {Boolean} includeDot whether hidden files can be included.
|
|
124
|
+
* @param {Array} ignoreList Directory patterns to ignore
|
|
125
|
+
*
|
|
126
|
+
* @returns {Array[string]} List of matched files
|
|
127
|
+
*/
|
|
128
|
+
export declare function getAllFilesWithIgnore(dirPath: string, pattern: string, includeDot: boolean, ignoreList: any[]): any;
|
|
129
|
+
/**
|
|
130
|
+
* Return the current timestamp in YYYY-MM-DDTHH:MM:SSZ format.
|
|
131
|
+
*
|
|
132
|
+
* @returns {string} ISO formatted timestamp, without milliseconds.
|
|
133
|
+
*/
|
|
134
|
+
export declare function getTimestamp(): string;
|
|
135
|
+
/**
|
|
136
|
+
* Return the temp directory, creating CDXGEN_TEMP_DIR when it is set but does
|
|
137
|
+
* not yet exist. Falls back to the OS tmpdir when unset.
|
|
138
|
+
*
|
|
139
|
+
* @returns {string} Resolved temp directory path.
|
|
140
|
+
*/
|
|
141
|
+
export declare function getTmpDir(): string;
|
|
142
|
+
/**
|
|
143
|
+
* Computes the checksum for a file path using the given hash algorithm
|
|
144
|
+
*
|
|
145
|
+
* @param {string} hashName name of hash algorithm
|
|
146
|
+
* @param {string} path path to file
|
|
147
|
+
* @returns {Promise<String>} hex value of hash
|
|
148
|
+
*/
|
|
149
|
+
export declare function checksumFile(hashName: string, path: string): Promise<string>;
|
|
150
|
+
/**
|
|
151
|
+
* Computes multiple checksum for a file path using the given hash algorithms
|
|
152
|
+
*
|
|
153
|
+
* @param {Array[String]} algorithms Array of algorithms
|
|
154
|
+
* @param {string} path path to file
|
|
155
|
+
* @returns {Promise<Object>} hashes object
|
|
156
|
+
*/
|
|
157
|
+
export declare function multiChecksumFile(algorithms: any, path: string): Promise<Object>;
|
|
158
|
+
//# sourceMappingURL=fs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fs.d.ts","sourceRoot":"","sources":["../../../lib/core/fs.js"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAsErC;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,QAAQ,QAAA,OAmCtC;AAED;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAAC,QAAQ,EAL3B,MAK2B,EAAE,IAAI,EAJjC,MAAM,GAAC,MAI0B,EAAE,OAAO,AAHlD,CACA,EADQ,MAG0C,GAFxC,IAAI,CA0BhB;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,QAAQ,QAAA,EAAE,OAAO,EAH5B,OAG4B,aAwB9C;AAED;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAJ3B,MAI2B,EAAE,OAAO,AAH5C,CACA,EADQ,MAAM,GAAC,MAGyC,GAF9C,MAAM,GAAC,SAAS,CAyB5B;AAED;;;;;;;GAOG;AACH,wBAAgB,UAAU,CAAC,QAAQ,EAJxB,MAIwB,EAAE,OAAO,AAHzC,CACA,EADQ,MAG6C,GAF3C,IAAI,CAchB;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAH5B,MAG4B,GAF1B,IAAI,CAchB;AAED;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EALzB,MAKyB,EAAE,IAAI,EAJ/B,MAI+B,EAAE,IAAI,AAH7C,CACA,EADQ,MAGiD,GAF/C,IAAI,CAkBhB;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,kBAAkB,CACtC,UAAU,EARD,MAQC,EACV,UAAU,EARD,MAQC,EACV,SAAS,EARA,kBAQA,EACT,IAAI,AARH,CACA,EADQ,MAQK,EACd,OAAO,AARN,CACA,EADQ,MAQU,GAPR,OAAO,CAAC,OAAO,CAAC,CAwD5B;AAED,sFAAsF;AACtF,eAAO,MAAM,cAAc,UAAY,CAAC;AASxC,2EAA2E;AAC3E,eAAO,MAAM,gBAAgB,UAAY,CAAC;AAuK1C;;;;;;;;;GASG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAL1B,MAK0B,EAAE,IAAI,EAJhC,MAAM,EAI0B,EAAE,OAAO,EAHzC,MAGyC,GAFvC,MAAM,CA8OlB;AAED,6FAA6F;AAC7F,eAAO,MAAM,UAAU,QAEP,CAAC;AAEjB,4GAA4G;AAC5G,eAAO,MAAM,UAAU,QAEJ,CAAC;AAEpB;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CAAC,OAAO,EANxB,MAMwB,EAAE,OAAO,EALjC,MAKiC,EAAE,OAAO,GAJ1C,MAI+C,OAuCzD;AA0BD;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAFhC,MAAM,GAAC,SAEyB,QAK1C;AA4BD;;;;;;GAMG;AACH,wBAAgB,uBAAuB,SAGtC;AAED;;;;;;;;;GASG;AACH,wBAAgB,qBAAqB,CACnC,OAAO,EARE,MAQF,EACP,OAAO,EARE,MAQF,EACP,UAAU,SAAA,EACV,UAAU,OAAA,OAmDX;AAED;;;;GAIG;AACH,wBAAgB,YAAY,IAFf,MAAM,CAIlB;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,IAFZ,MAAM,CAYlB;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,QAAQ,EAJ1B,MAI0B,EAAE,IAAI,EAHhC,MAGgC,GAF9B,OAAO,QAAQ,CAU3B;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,UAAU,KAAA,EAAE,IAAI,EAHvC,MAGuC,GAFrC,OAAO,CAAC,MAAM,CAAC,CA8B3B"}
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A tiny, `got`-compatible HTTP client built on top of undici.
|
|
3
|
+
*
|
|
4
|
+
* cdxgen historically relied on the `got` library. `got` keeps a per-request
|
|
5
|
+
* HTTP cache backed by an EventEmitter which, during large `--deep` scans that
|
|
6
|
+
* issue thousands of parallel license/metadata lookups, leaks "error" listeners
|
|
7
|
+
* and floods the console with `MaxListenersExceededWarning` messages. undici
|
|
8
|
+
* uses a pooled dispatcher and does not exhibit this behaviour.
|
|
9
|
+
*
|
|
10
|
+
* This module intentionally implements only the subset of the `got` surface
|
|
11
|
+
* that cdxgen consumes:
|
|
12
|
+
*
|
|
13
|
+
* - Callable form: `client(url, options)` and the verb helpers `client.get`,
|
|
14
|
+
* `client.post`, `client.put` and `client.head`.
|
|
15
|
+
* - `client.extend(defaults)` to derive a new client with merged defaults.
|
|
16
|
+
* - Request options: `method`, `headers`, `body`, `json`, `responseType`
|
|
17
|
+
* (`"json"` | `"buffer"` | `"text"`), `throwHttpErrors`, `followRedirect`,
|
|
18
|
+
* `timeout` (number of milliseconds or a `got`-style phase object), `retry`
|
|
19
|
+
* (accepted for API compatibility; no automatic retries are performed),
|
|
20
|
+
* `https.rejectUnauthorized` and `context`.
|
|
21
|
+
* - `beforeRequest`, `afterResponse` and `beforeError` hooks with the same
|
|
22
|
+
* calling conventions cdxgen uses today. These hooks continue to power
|
|
23
|
+
* cdxgen's dry-run enforcement, host allow-listing, network-activity
|
|
24
|
+
* recording and HTTP trace logging.
|
|
25
|
+
* - Automatic response decompression (`gzip`, `deflate`, `br`) driven by the
|
|
26
|
+
* `Content-Encoding` header, matching `got`'s transparent decoding.
|
|
27
|
+
* - Proxy support via the standard `HTTP_PROXY`/`HTTPS_PROXY`/`NO_PROXY`
|
|
28
|
+
* environment variables (through undici's `EnvHttpProxyAgent`).
|
|
29
|
+
* - An in-memory GET response cache (enabled by default, disabled by setting
|
|
30
|
+
* the `CDXGEN_NO_CACHE` environment variable) that replaces the got + Keyv
|
|
31
|
+
* cache cdxgen previously relied on.
|
|
32
|
+
* - Response objects exposing `statusCode`, `headers`, `body`, `rawBody`,
|
|
33
|
+
* `url` and `request.options`.
|
|
34
|
+
* - A lazily-resolved `.json()` method on the returned promise, mirroring
|
|
35
|
+
* `got`'s `client(url).json()` usage.
|
|
36
|
+
*
|
|
37
|
+
* @module httpClient
|
|
38
|
+
*/
|
|
39
|
+
/**
|
|
40
|
+
* Error thrown when the server responds with a non 2xx/3xx status code and
|
|
41
|
+
* `throwHttpErrors` has not been disabled. Shaped like `got`'s `HTTPError` so
|
|
42
|
+
* that existing `error.response.statusCode` and `error.options.context` checks
|
|
43
|
+
* keep working.
|
|
44
|
+
*/
|
|
45
|
+
export declare class HTTPError extends Error {
|
|
46
|
+
response: Object;
|
|
47
|
+
options: Object;
|
|
48
|
+
code: string;
|
|
49
|
+
/**
|
|
50
|
+
* @param {Object} response Response object produced by this client.
|
|
51
|
+
* @param {Object} options Merged request options for the failed request.
|
|
52
|
+
*/
|
|
53
|
+
constructor(response: Object, options: Object);
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Error thrown for transport-level failures (DNS, connection reset, timeouts).
|
|
57
|
+
* Carries the merged request `options` so `beforeError` hooks can inspect the
|
|
58
|
+
* request context.
|
|
59
|
+
*/
|
|
60
|
+
export declare class RequestError extends Error {
|
|
61
|
+
options: Object;
|
|
62
|
+
code: any;
|
|
63
|
+
cause: Error;
|
|
64
|
+
/**
|
|
65
|
+
* @param {Error} cause Underlying error thrown by undici.
|
|
66
|
+
* @param {Object} options Merged request options for the failed request.
|
|
67
|
+
*/
|
|
68
|
+
constructor(cause: Error, options: Object);
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Resolve the default HTTP request timeout, honoring the validated
|
|
72
|
+
* CDXGEN_HTTP_TIMEOUT_MS environment variable when set to a positive integer.
|
|
73
|
+
*
|
|
74
|
+
* @returns {number} Timeout in milliseconds
|
|
75
|
+
*/
|
|
76
|
+
export declare function getDefaultHttpTimeoutMs(): number;
|
|
77
|
+
/**
|
|
78
|
+
* Translate a `got`-style timeout option into a single total-request timeout in
|
|
79
|
+
* milliseconds suitable for `AbortSignal.timeout`. A plain number is used
|
|
80
|
+
* verbatim. A phase object (e.g. `{ connect, send, response }`, or `{ request }`)
|
|
81
|
+
* is reduced to the sum of its numeric phases, which provides a sensible upper
|
|
82
|
+
* bound for the whole request.
|
|
83
|
+
*
|
|
84
|
+
* @param {number|Object} [timeout] `got`-style timeout option.
|
|
85
|
+
* @returns {number|undefined} Total timeout in milliseconds, or `undefined`.
|
|
86
|
+
*/
|
|
87
|
+
export declare function resolveTimeout(timeout?: number | Object): number | undefined;
|
|
88
|
+
/**
|
|
89
|
+
* Determine whether the in-memory HTTP response cache is disabled via the
|
|
90
|
+
* CDXGEN_NO_CACHE environment variable. Evaluated per request so tests and
|
|
91
|
+
* callers can toggle it at runtime.
|
|
92
|
+
*
|
|
93
|
+
* @returns {boolean} True when caching should be skipped.
|
|
94
|
+
*/
|
|
95
|
+
export declare function isCacheDisabled(): boolean;
|
|
96
|
+
/**
|
|
97
|
+
* Clear the in-memory HTTP response cache. Primarily useful for tests.
|
|
98
|
+
*
|
|
99
|
+
* @returns {void}
|
|
100
|
+
*/
|
|
101
|
+
export declare function clearHttpCache(): void;
|
|
102
|
+
/**
|
|
103
|
+
* Error thrown when a cassette replay session encounters a request with no
|
|
104
|
+
* matching recorded interaction. This is loud-by-design: a silent fall-
|
|
105
|
+
* through to the live network would make offline golden tests meaningless.
|
|
106
|
+
*/
|
|
107
|
+
export declare class CassetteMissError extends Error {
|
|
108
|
+
method: string;
|
|
109
|
+
url: string;
|
|
110
|
+
/**
|
|
111
|
+
* @param {string} method HTTP method.
|
|
112
|
+
* @param {string} url Request URL.
|
|
113
|
+
*/
|
|
114
|
+
constructor(method: string, url: string);
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Install an HTTP interceptor that acts as the single network seam for test
|
|
118
|
+
* cassettes. The interceptor receives a request descriptor and must return
|
|
119
|
+
* either a `got`-like response object (replay hit) or `null` (pass-through /
|
|
120
|
+
* record mode).
|
|
121
|
+
*
|
|
122
|
+
* @param {(req: { method: string, url: URL, headers: Object, body: *, responseType?: string, options: Object }) => Promise<Object|null>} fn
|
|
123
|
+
* Interceptor function.
|
|
124
|
+
* @returns {void}
|
|
125
|
+
*/
|
|
126
|
+
export declare function setHttpInterceptor(fn: (req: {
|
|
127
|
+
method: string;
|
|
128
|
+
url: URL;
|
|
129
|
+
headers: Object;
|
|
130
|
+
body: any;
|
|
131
|
+
responseType?: string;
|
|
132
|
+
options: Object;
|
|
133
|
+
}) => Promise<Object | null>): void;
|
|
134
|
+
/**
|
|
135
|
+
* Remove the currently-installed HTTP interceptor, restoring normal network
|
|
136
|
+
* behaviour.
|
|
137
|
+
*
|
|
138
|
+
* @returns {void}
|
|
139
|
+
*/
|
|
140
|
+
export declare function clearHttpInterceptor(): void;
|
|
141
|
+
/**
|
|
142
|
+
* Create a `got`-compatible HTTP client bound to the supplied defaults.
|
|
143
|
+
*
|
|
144
|
+
* @param {Object} [defaults] Default request options merged into every call.
|
|
145
|
+
* @returns {Function} Callable client exposing `get`/`post`/`put`/`head`,
|
|
146
|
+
* `extend`, `defaults` and `hooks`.
|
|
147
|
+
*/
|
|
148
|
+
export declare function createHttpClient(defaults?: Object): Function;
|
|
149
|
+
//# sourceMappingURL=httpClient.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"httpClient.d.ts","sourceRoot":"","sources":["../../../lib/core/httpClient.js"],"names":[],"mappings":"AAeA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAEH;;;;;GAKG;AACH,qBAAa,SAAU,SAAQ,KAAK;IAU3B,QAAQ;IACR,OAAO;IACP,IAAI;IAXX;;;OAGG;IACH,YAAY,QAAQ,EAHT,MAGS,EAAE,OAAO,EAFlB,MAEkB,EAQ5B;CACF;AAED;;;;GAIG;AACH,qBAAa,YAAa,SAAQ,KAAK;IAQ9B,OAAO;IACP,IAAI;IACJ,KAAK;IATZ;;;OAGG;IACH,YAAY,KAAK,EAHN,KAGM,EAAE,OAAO,EAFf,MAEe,EAMzB;CACF;AA8DD;;;;;GAKG;AACH,wBAAgB,uBAAuB,IAF1B,MAAM,CAYlB;AAED;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAAC,OAAO,AAHnC,CACA,EADQ,MAAM,GAAC,MAGoB,GAFzB,MAAM,GAAC,SAAS,CAyB5B;AAwGD;;;;;;GAMG;AACH,wBAAgB,eAAe,IAFlB,OAAO,CAKnB;AAED;;;;GAIG;AACH,wBAAgB,cAAc,IAFjB,IAAI,CAIhB;AAkBD;;;;GAIG;AACH,qBAAa,iBAAkB,SAAQ,KAAK;IAUnC,MAAM;IACN,GAAG;IAVV;;;OAGG;IACH,YAAY,MAAM,EAHP,MAGO,EAAE,GAAG,EAFZ,MAEY,EAOtB;CACF;AASD;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,CAAC,EAAE,EAJ1B,CAAC,GAAG,EAAE;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,GAAG,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,GAAC,CAAC;IAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,KAAK,OAAO,CAAC,MAAM,GAAC,IAAI,CAIlG,GAFxB,IAAI,CAIhB;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,IAFvB,IAAI,CAIhB;AA8RD;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,AAJtC,CACA,EADQ,MAImC,YAwC7C"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/** True when thought/reasoning logging is enabled (CDXGEN_THOUGHT_LOG, CDXGEN_THINK_MODE, or verbose debug mode). */
|
|
2
|
+
export declare const THINK_MODE: any;
|
|
3
|
+
/** True when structured command/HTTP trace logging is enabled (CDXGEN_TRACE_LOG, CDXGEN_TRACE_ID, CDXGEN_TRACE_MODE, or verbose debug mode). */
|
|
4
|
+
export declare const TRACE_MODE: any;
|
|
5
|
+
/**
|
|
6
|
+
* Logs a thought message to the think logger if THINK_MODE is enabled.
|
|
7
|
+
* Automatically appends a period to the message if it lacks terminal punctuation.
|
|
8
|
+
*
|
|
9
|
+
* @param {string} s The thought message to log
|
|
10
|
+
* @param {Object} [args] Optional additional arguments to log alongside the message
|
|
11
|
+
* @returns {void}
|
|
12
|
+
*/
|
|
13
|
+
export declare function thoughtLog(s: string, args?: Object): void;
|
|
14
|
+
/**
|
|
15
|
+
* Closes the think log group by emitting the closing `</think>` marker.
|
|
16
|
+
* Has no effect if THINK_MODE is not enabled.
|
|
17
|
+
*
|
|
18
|
+
* @returns {void}
|
|
19
|
+
*/
|
|
20
|
+
export declare function thoughtEnd(): void;
|
|
21
|
+
/**
|
|
22
|
+
* Log trace messages
|
|
23
|
+
*
|
|
24
|
+
* @param {String} traceType Trace type
|
|
25
|
+
* @param {Object} args Additional arguments
|
|
26
|
+
*/
|
|
27
|
+
export declare function traceLog(traceType: string, args: Object): void;
|
|
28
|
+
//# sourceMappingURL=logger.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../../lib/core/logger.js"],"names":[],"mappings":"AAoBA,qHAAqH;AACrH,eAAO,MAAM,UAAU,KAGsB,CAAC;AAc9C,gJAAgJ;AAChJ,eAAO,MAAM,UAAU,KAIsB,CAAC;AAiB9C;;;;;;;GAOG;AACH,wBAAgB,UAAU,CAAC,CAAC,EAJjB,MAIiB,EAAE,IAAI,AAH/B,CACA,EADQ,MAGuB,GAFrB,IAAI,CAehB;AACD;;;;;GAKG;AACH,wBAAgB,UAAU,IAFb,IAAI,CAOhB;AAYD;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,SAAS,QAAA,EAAE,IAAI,EAF7B,MAE6B,QA8BvC"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bounded concurrency utilities for CPU-bound and I/O-bound parallel work.
|
|
3
|
+
*
|
|
4
|
+
* Two primitives live here:
|
|
5
|
+
*
|
|
6
|
+
* - {@link mapWithConcurrency} — a promise pool for async I/O work (file
|
|
7
|
+
* hashing, registry fetches). Tasks are async; results preserve input order.
|
|
8
|
+
*
|
|
9
|
+
* - {@link mapInWorkers} — a worker-thread pool for synchronous CPU work (AST
|
|
10
|
+
* parsing). Below a configurable threshold tasks run inline; above it they
|
|
11
|
+
* are distributed across `worker_threads` workers. Any failure of the thread
|
|
12
|
+
* machinery itself — an unavailable `worker_threads`, a worker entry that
|
|
13
|
+
* will not load, a worker that dies mid-task — falls back to running the
|
|
14
|
+
* remaining tasks inline, so the result is the same whether or not threads
|
|
15
|
+
* were usable.
|
|
16
|
+
*/
|
|
17
|
+
/**
|
|
18
|
+
* Run an async mapper over an array with bounded concurrency.
|
|
19
|
+
*
|
|
20
|
+
* Results are placed at their original index so order is preserved regardless
|
|
21
|
+
* of completion order. Below the concurrency limit tasks start immediately;
|
|
22
|
+
* above it they queue in FIFO order.
|
|
23
|
+
*
|
|
24
|
+
* The bound is per call, so two pools running at once can together hold twice
|
|
25
|
+
* the limit open. Every caller today awaits its pool before the next phase
|
|
26
|
+
* begins, so the effective bound is the limit; a caller that starts a pool
|
|
27
|
+
* without awaiting it should pass a smaller `concurrency`.
|
|
28
|
+
*
|
|
29
|
+
* @template T, R
|
|
30
|
+
* @param {Array<T>} items
|
|
31
|
+
* @param {(item: T, index: number) => Promise<R>|R} mapper
|
|
32
|
+
* @param {number} [concurrency]
|
|
33
|
+
* @returns {Promise<Array<R>>}
|
|
34
|
+
*/
|
|
35
|
+
export declare function mapWithConcurrency<T, R>(items: Array<T>, mapper: (item: T, index: number) => Promise<R> | R, concurrency?: number): Promise<Array<R>>;
|
|
36
|
+
/**
|
|
37
|
+
* Maximum number of worker threads the pool will create for a single call.
|
|
38
|
+
*
|
|
39
|
+
* @returns {number}
|
|
40
|
+
*/
|
|
41
|
+
export declare function getMaxWorkers(): number;
|
|
42
|
+
/**
|
|
43
|
+
* The task count at or above which {@link mapInWorkers} dispatches to threads
|
|
44
|
+
* instead of running inline.
|
|
45
|
+
*
|
|
46
|
+
* @returns {number}
|
|
47
|
+
*/
|
|
48
|
+
export declare function getWorkerThreshold(): number;
|
|
49
|
+
/**
|
|
50
|
+
* Workers created by the most recent {@link mapInWorkers} call. Scoped to that
|
|
51
|
+
* one call rather than to the process, so a batch that ran inline reports 0
|
|
52
|
+
* rather than the widest earlier batch.
|
|
53
|
+
*
|
|
54
|
+
* @returns {number}
|
|
55
|
+
*/
|
|
56
|
+
export declare function lastWorkerPoolSize(): number;
|
|
57
|
+
/**
|
|
58
|
+
* Run synchronous CPU-bound tasks across worker threads.
|
|
59
|
+
*
|
|
60
|
+
* Below the threshold (default 24), tasks run inline on the calling thread,
|
|
61
|
+
* because starting a worker costs more than a small batch saves. Above it,
|
|
62
|
+
* tasks are distributed to a pool of ephemeral workers that are terminated
|
|
63
|
+
* before the call returns, so a completed scan does not hold the event loop
|
|
64
|
+
* open.
|
|
65
|
+
*
|
|
66
|
+
* Results are always returned in the original task order.
|
|
67
|
+
*
|
|
68
|
+
* Two kinds of failure are distinguished. A task that fails inside the worker
|
|
69
|
+
* is reported by the worker as `{error}` and is treated as that one task
|
|
70
|
+
* failing: it yields `options.errorResult` when `options.swallowErrors` is set,
|
|
71
|
+
* and rejects otherwise. A failure of the thread machinery — `worker_threads`
|
|
72
|
+
* missing, the entry module refusing to load, a worker exiting mid-task — is
|
|
73
|
+
* not a property of any task, so the tasks that had not completed are run
|
|
74
|
+
* inline instead. That keeps the result independent of whether threads were
|
|
75
|
+
* usable, which matters because callers of this function treat an empty result
|
|
76
|
+
* as "nothing found" rather than as an error.
|
|
77
|
+
*
|
|
78
|
+
* @template T, R
|
|
79
|
+
* @param {URL|string} workerUrl - Resolved URL of the worker entry module
|
|
80
|
+
* @param {Array<T>} tasks - Structured-cloneable task descriptors
|
|
81
|
+
* @param {(task: T) => R} inlineFn - Called per task when running inline
|
|
82
|
+
* @param {Object} [options]
|
|
83
|
+
* @param {number} [options.threshold] - Minimum task count to use threads
|
|
84
|
+
* @param {number} [options.maxWorkers] - Cap on thread count
|
|
85
|
+
* @param {boolean} [options.swallowErrors] - Return errorResult instead of rejecting
|
|
86
|
+
* @param {R} [options.errorResult] - Value used when an error is swallowed
|
|
87
|
+
* @returns {Promise<Array<R|null>>}
|
|
88
|
+
*/
|
|
89
|
+
export declare function mapInWorkers<T, R>(workerUrl: URL | string, tasks: Array<T>, inlineFn: (task: T) => R, options?: {
|
|
90
|
+
threshold?: number;
|
|
91
|
+
maxWorkers?: number;
|
|
92
|
+
swallowErrors?: boolean;
|
|
93
|
+
errorResult?: R;
|
|
94
|
+
}): Promise<Array<R | null>>;
|
|
95
|
+
//# sourceMappingURL=parallel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parallel.d.ts","sourceRoot":"","sources":["../../../lib/core/parallel.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAyBH;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAsB,kBAAkB,CAN3B,CAAC,EAAE,CAAC,EAMwB,KAAK,EALnC,KAAK,CAAC,CAAC,CAK4B,EAAE,MAAM,EAJ3C,CAAC,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,CAAC,CAAC,GAAC,CAII,EAAE,WAAW,AAHhE,CACA,EADQ,MAGwD,GAFtD,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAsB7B;AAED;;;;GAIG;AACH,wBAAgB,aAAa,IAFhB,MAAM,CAIlB;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,IAFrB,MAAM,CAIlB;AAKD;;;;;;GAMG;AACH,wBAAgB,kBAAkB,IAFrB,MAAM,CAIlB;AAuDD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,wBAAsB,YAAY,CAXrB,CAAC,EAAE,CAAC,EAWkB,SAAS,EAVjC,GAAG,GAAC,MAU6B,EAAE,KAAK,EATxC,KAAK,CAAC,CAAC,CASiC,EAAE,QAAQ,EARlD,CAAC,IAAI,EAAE,CAAC,KAAK,CAQqC,EAAE,OAAO,AAPnE,CAKA,EAJA;IAAyB,SAAS,AAAlC,CACA,EADQ,MAAM,CACd;IAAyB,UAAU,AAAnC,CACA,EADQ,MAAM,CACd;IAA0B,aAAa,AAAvC,CACA,EADQ,OAAO,CACf;IAAoB,WAAW,AAA/B,CACA,EADQ,CAAC,CACT;CAEwE,GAF9D,OAAO,CAAC,KAAK,CAAC,CAAC,GAAC,IAAI,CAAC,CAAC,CA8HlC"}
|