@cdxgen/cdxgen 13.0.1 → 13.2.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 +30 -16
- package/bin/audit.js +6 -0
- package/bin/cdxgen.js +141 -7
- package/bin/evinse.js +3 -1
- package/data/component-tags.json +8 -1
- package/data/crypto-oid.json +88 -12
- package/data/frameworks-list.json +86 -1
- package/data/remediations.json +1167 -0
- package/data/rules/ai-bom.yaml +78 -0
- package/data/rules/asar-archives.yaml +1 -1
- package/data/rules/build-fidelity.yaml +782 -0
- package/data/rules/cargo-rust.yaml +132 -0
- package/data/rules/mcp-servers.yaml +122 -0
- package/data/rules/package-integrity.yaml +13 -13
- package/lib/audit/index.js +48 -4
- package/lib/audit/scoring.js +2 -8
- package/lib/audit/targets.js +6 -1
- package/lib/cli/bomAssembly.js +32 -1
- package/lib/cli/cliOptions.js +94 -7
- package/lib/cli/index.js +268 -49
- package/lib/cli/jsBom.js +91 -5
- package/lib/cli/jvmBom.js +1515 -1314
- package/lib/cli/managedBom.js +249 -28
- package/lib/cli/nativeBom.js +986 -10
- package/lib/core/activity.js +120 -2
- package/lib/core/buildLedger.js +799 -0
- package/lib/core/deferredExit.js +141 -0
- package/lib/core/env.js +108 -2
- package/lib/core/fs.js +60 -0
- package/lib/core/logger.js +12 -99
- package/lib/core/severity.js +16 -0
- package/lib/core/syncFileWriter.js +106 -0
- package/lib/core/userAgent.js +151 -0
- package/lib/ecosystems/cargoCache.js +364 -0
- package/lib/ecosystems/caxa.js +13 -5
- package/lib/ecosystems/cppEvidence.js +40 -2
- package/lib/ecosystems/ecosystems.js +250 -91
- package/lib/ecosystems/golem.js +11 -1
- package/lib/ecosystems/gradleutils.js +498 -17
- package/lib/ecosystems/kosi.js +1256 -0
- package/lib/ecosystems/parsers-crystal.js +179 -0
- package/lib/ecosystems/parsers-dotnet.js +69 -39
- package/lib/ecosystems/parsers-elm.js +816 -0
- package/lib/ecosystems/parsers-gleam.js +1 -1
- package/lib/ecosystems/parsers-js.js +26 -0
- package/lib/ecosystems/parsers-julia.js +268 -0
- package/lib/ecosystems/parsers-jvm.js +9 -0
- package/lib/ecosystems/parsers-lua.js +218 -0
- package/lib/ecosystems/parsers-misc.js +188 -2
- package/lib/ecosystems/parsers-nim.js +221 -0
- package/lib/ecosystems/parsers-opam.js +180 -0
- package/lib/ecosystems/parsers-perl.js +277 -0
- package/lib/ecosystems/parsers-python.js +172 -36
- package/lib/ecosystems/parsers-r.js +148 -0
- package/lib/ecosystems/parsers-rebar.js +411 -0
- package/lib/ecosystems/parsers-rust.js +944 -19
- package/lib/ecosystems/parsers-spack.js +204 -0
- package/lib/ecosystems/parsers-stack.js +264 -0
- package/lib/ecosystems/parsers-terraform.js +194 -0
- package/lib/ecosystems/pypiClassifiers.js +326 -0
- package/lib/ecosystems/pythonutils.js +49 -1
- package/lib/ecosystems/rubyutils.js +13 -0
- package/lib/ecosystems/rusi.js +126 -6
- package/lib/evinser/evinser.js +141 -13
- package/lib/helpers/agenticToolutils.js +925 -0
- package/lib/helpers/remote/dependency-track.js +81 -14
- package/lib/inventory/agentFormulationParser.js +57 -4
- package/lib/inventory/aiCollector.js +504 -10
- package/lib/inventory/aiInventory.js +12 -0
- package/lib/inventory/analyzer.js +488 -30
- package/lib/inventory/astWorker.js +6 -0
- package/lib/inventory/auditCategories.js +17 -0
- package/lib/inventory/cbomutils.js +30 -0
- package/lib/inventory/cdxrs.js +7 -2
- package/lib/inventory/communityAiConfigParser.js +215 -2
- package/lib/inventory/depsUtils.js +72 -0
- package/lib/inventory/dosai.js +508 -22
- package/lib/inventory/envcontext.js +215 -24
- package/lib/inventory/evidenceUtils.js +13 -0
- package/lib/inventory/fetchBatch.js +131 -2
- package/lib/inventory/fetchRate.js +74 -11
- package/lib/inventory/forgeEnricher.js +3 -2
- package/lib/inventory/jvmToolEnv.js +594 -0
- package/lib/inventory/mcpConfigParser.js +166 -2
- package/lib/inventory/mcpDiscovery.js +11 -0
- package/lib/inventory/mcpServerManifest.js +389 -0
- package/lib/inventory/mcpbBundle.js +419 -0
- package/lib/inventory/osinfo.js +1 -0
- package/lib/inventory/plugins.js +3 -0
- package/lib/inventory/protobom.js +54 -88
- package/lib/inventory/protobomLoader.js +4 -0
- package/lib/inventory/rustFormulationParser.js +1 -1
- package/lib/inventory/source.js +10 -4
- package/lib/inventory/stylePackageRefs.js +41 -0
- package/lib/inventory/svelteUtils.js +524 -0
- package/lib/inventory/toolRequirements.js +903 -0
- package/lib/managers/binary.js +24 -0
- package/lib/managers/docker.js +26 -5
- package/lib/parsers/huggingfaceUtils.js +15 -7
- package/lib/parsers/onnx.js +294 -0
- package/lib/parsers/safetensors.js +114 -0
- package/lib/server/server.js +1 -1
- package/lib/stages/postgen/annotationBuilder.js +97 -0
- package/lib/stages/postgen/auditBom.js +76 -79
- package/lib/stages/postgen/introspection/annotate.js +320 -0
- package/lib/stages/postgen/introspection/commandFacts.js +293 -0
- package/lib/stages/postgen/introspection/emit.js +192 -0
- package/lib/stages/postgen/introspection/formulationEvidence.js +427 -0
- package/lib/stages/postgen/introspection/markers.js +250 -0
- package/lib/stages/postgen/introspection/reflect.js +1214 -0
- package/lib/stages/postgen/introspection/report.js +1208 -0
- package/lib/stages/postgen/introspection/score.js +1067 -0
- package/lib/stages/postgen/introspection/shapeCommand.js +304 -0
- package/lib/stages/postgen/parentEdge.js +156 -0
- package/lib/stages/postgen/postgen.js +284 -3
- package/lib/stages/postgen/ruleEngine.js +17 -0
- package/lib/stages/pregen/envAudit.js +42 -2
- package/lib/stages/pregen/pregen.js +1171 -6
- package/lib/third-party/arborist/snapshots/calc-dep-flags.test.cjs +462 -0
- package/lib/validator/bomValidator.js +11 -2
- package/package.json +26 -26
- package/types/lib/audit/index.d.ts.map +1 -1
- package/types/lib/audit/scoring.d.ts +2 -8
- package/types/lib/audit/scoring.d.ts.map +1 -1
- package/types/lib/audit/targets.d.ts.map +1 -1
- package/types/lib/cli/bomAssembly.d.ts.map +1 -1
- package/types/lib/cli/cliOptions.d.ts +2 -1
- package/types/lib/cli/cliOptions.d.ts.map +1 -1
- package/types/lib/cli/index.d.ts +10 -2
- package/types/lib/cli/index.d.ts.map +1 -1
- package/types/lib/cli/jsBom.d.ts +23 -0
- package/types/lib/cli/jsBom.d.ts.map +1 -1
- package/types/lib/cli/jvmBom.d.ts.map +1 -1
- package/types/lib/cli/managedBom.d.ts +33 -0
- package/types/lib/cli/managedBom.d.ts.map +1 -1
- package/types/lib/cli/nativeBom.d.ts +88 -8
- package/types/lib/cli/nativeBom.d.ts.map +1 -1
- package/types/lib/core/activity.d.ts.map +1 -1
- package/types/lib/core/buildLedger.d.ts +272 -0
- package/types/lib/core/buildLedger.d.ts.map +1 -0
- package/types/lib/core/deferredExit.d.ts +84 -0
- package/types/lib/core/deferredExit.d.ts.map +1 -0
- package/types/lib/core/env.d.ts +43 -1
- package/types/lib/core/env.d.ts.map +1 -1
- package/types/lib/core/fs.d.ts +21 -0
- package/types/lib/core/fs.d.ts.map +1 -1
- package/types/lib/core/logger.d.ts +2 -11
- package/types/lib/core/logger.d.ts.map +1 -1
- package/types/lib/core/severity.d.ts +11 -0
- package/types/lib/core/severity.d.ts.map +1 -0
- package/types/lib/core/syncFileWriter.d.ts +33 -0
- package/types/lib/core/syncFileWriter.d.ts.map +1 -0
- package/types/lib/core/userAgent.d.ts +56 -0
- package/types/lib/core/userAgent.d.ts.map +1 -0
- package/types/lib/ecosystems/cargoCache.d.ts +75 -0
- package/types/lib/ecosystems/cargoCache.d.ts.map +1 -0
- package/types/lib/ecosystems/caxa.d.ts.map +1 -1
- package/types/lib/ecosystems/cppEvidence.d.ts +1 -1
- package/types/lib/ecosystems/cppEvidence.d.ts.map +1 -1
- package/types/lib/ecosystems/ecosystems.d.ts +15 -1
- package/types/lib/ecosystems/ecosystems.d.ts.map +1 -1
- package/types/lib/ecosystems/gradleutils.d.ts +53 -0
- package/types/lib/ecosystems/gradleutils.d.ts.map +1 -1
- package/types/lib/ecosystems/kosi.d.ts +73 -0
- package/types/lib/ecosystems/kosi.d.ts.map +1 -0
- package/types/lib/ecosystems/parsers-crystal.d.ts +27 -0
- package/types/lib/ecosystems/parsers-crystal.d.ts.map +1 -0
- package/types/lib/ecosystems/parsers-dotnet.d.ts +19 -0
- package/types/lib/ecosystems/parsers-dotnet.d.ts.map +1 -1
- package/types/lib/ecosystems/parsers-elm.d.ts +79 -0
- package/types/lib/ecosystems/parsers-elm.d.ts.map +1 -0
- package/types/lib/ecosystems/parsers-js.d.ts.map +1 -1
- package/types/lib/ecosystems/parsers-julia.d.ts +57 -0
- package/types/lib/ecosystems/parsers-julia.d.ts.map +1 -0
- package/types/lib/ecosystems/parsers-jvm.d.ts.map +1 -1
- package/types/lib/ecosystems/parsers-lua.d.ts +50 -0
- package/types/lib/ecosystems/parsers-lua.d.ts.map +1 -0
- package/types/lib/ecosystems/parsers-misc.d.ts +23 -0
- package/types/lib/ecosystems/parsers-misc.d.ts.map +1 -1
- package/types/lib/ecosystems/parsers-nim.d.ts +43 -0
- package/types/lib/ecosystems/parsers-nim.d.ts.map +1 -0
- package/types/lib/ecosystems/parsers-opam.d.ts +31 -0
- package/types/lib/ecosystems/parsers-opam.d.ts.map +1 -0
- package/types/lib/ecosystems/parsers-perl.d.ts +36 -0
- package/types/lib/ecosystems/parsers-perl.d.ts.map +1 -0
- package/types/lib/ecosystems/parsers-python.d.ts.map +1 -1
- package/types/lib/ecosystems/parsers-r.d.ts +35 -0
- package/types/lib/ecosystems/parsers-r.d.ts.map +1 -0
- package/types/lib/ecosystems/parsers-rebar.d.ts +42 -0
- package/types/lib/ecosystems/parsers-rebar.d.ts.map +1 -0
- package/types/lib/ecosystems/parsers-rust.d.ts +199 -0
- package/types/lib/ecosystems/parsers-rust.d.ts.map +1 -1
- package/types/lib/ecosystems/parsers-spack.d.ts +33 -0
- package/types/lib/ecosystems/parsers-spack.d.ts.map +1 -0
- package/types/lib/ecosystems/parsers-stack.d.ts +35 -0
- package/types/lib/ecosystems/parsers-stack.d.ts.map +1 -0
- package/types/lib/ecosystems/parsers-terraform.d.ts +34 -0
- package/types/lib/ecosystems/parsers-terraform.d.ts.map +1 -0
- package/types/lib/ecosystems/pypiClassifiers.d.ts +80 -0
- package/types/lib/ecosystems/pypiClassifiers.d.ts.map +1 -0
- package/types/lib/ecosystems/pythonutils.d.ts +21 -1
- package/types/lib/ecosystems/pythonutils.d.ts.map +1 -1
- package/types/lib/ecosystems/rubyutils.d.ts.map +1 -1
- package/types/lib/ecosystems/rusi.d.ts.map +1 -1
- package/types/lib/evinser/evinser.d.ts +34 -1
- package/types/lib/evinser/evinser.d.ts.map +1 -1
- package/types/lib/helpers/agenticToolutils.d.ts +87 -0
- package/types/lib/helpers/agenticToolutils.d.ts.map +1 -0
- package/types/lib/helpers/remote/dependency-track.d.ts +45 -4
- package/types/lib/helpers/remote/dependency-track.d.ts.map +1 -1
- package/types/lib/inventory/agentFormulationParser.d.ts.map +1 -1
- package/types/lib/inventory/aiCollector.d.ts.map +1 -1
- package/types/lib/inventory/aiInventory.d.ts.map +1 -1
- package/types/lib/inventory/analyzer.d.ts.map +1 -1
- package/types/lib/inventory/auditCategories.d.ts +12 -0
- package/types/lib/inventory/auditCategories.d.ts.map +1 -1
- package/types/lib/inventory/cbomutils.d.ts.map +1 -1
- package/types/lib/inventory/communityAiConfigParser.d.ts.map +1 -1
- package/types/lib/inventory/depsUtils.d.ts.map +1 -1
- package/types/lib/inventory/dosai.d.ts +43 -0
- package/types/lib/inventory/dosai.d.ts.map +1 -1
- package/types/lib/inventory/envcontext.d.ts.map +1 -1
- package/types/lib/inventory/evidenceUtils.d.ts.map +1 -1
- package/types/lib/inventory/fetchBatch.d.ts +43 -0
- package/types/lib/inventory/fetchBatch.d.ts.map +1 -1
- package/types/lib/inventory/fetchRate.d.ts +9 -6
- package/types/lib/inventory/fetchRate.d.ts.map +1 -1
- package/types/lib/inventory/forgeEnricher.d.ts.map +1 -1
- package/types/lib/inventory/jvmToolEnv.d.ts +190 -0
- package/types/lib/inventory/jvmToolEnv.d.ts.map +1 -0
- package/types/lib/inventory/mcpConfigParser.d.ts.map +1 -1
- package/types/lib/inventory/mcpDiscovery.d.ts.map +1 -1
- package/types/lib/inventory/mcpServerManifest.d.ts +19 -0
- package/types/lib/inventory/mcpServerManifest.d.ts.map +1 -0
- package/types/lib/inventory/mcpbBundle.d.ts +19 -0
- package/types/lib/inventory/mcpbBundle.d.ts.map +1 -0
- package/types/lib/inventory/osinfo.d.ts.map +1 -1
- package/types/lib/inventory/plugins.d.ts.map +1 -1
- package/types/lib/inventory/protobom.d.ts +18 -13
- package/types/lib/inventory/protobom.d.ts.map +1 -1
- package/types/lib/inventory/protobomLoader.d.ts.map +1 -1
- package/types/lib/inventory/source.d.ts.map +1 -1
- package/types/lib/inventory/stylePackageRefs.d.ts +17 -0
- package/types/lib/inventory/stylePackageRefs.d.ts.map +1 -0
- package/types/lib/inventory/svelteUtils.d.ts +124 -0
- package/types/lib/inventory/svelteUtils.d.ts.map +1 -0
- package/types/lib/inventory/toolRequirements.d.ts +216 -0
- package/types/lib/inventory/toolRequirements.d.ts.map +1 -0
- package/types/lib/managers/binary.d.ts.map +1 -1
- package/types/lib/managers/docker.d.ts.map +1 -1
- package/types/lib/parsers/huggingfaceUtils.d.ts +8 -1
- package/types/lib/parsers/huggingfaceUtils.d.ts.map +1 -1
- package/types/lib/parsers/onnx.d.ts +28 -0
- package/types/lib/parsers/onnx.d.ts.map +1 -0
- package/types/lib/parsers/safetensors.d.ts +22 -0
- package/types/lib/parsers/safetensors.d.ts.map +1 -0
- package/types/lib/stages/postgen/annotationBuilder.d.ts +53 -0
- package/types/lib/stages/postgen/annotationBuilder.d.ts.map +1 -0
- package/types/lib/stages/postgen/auditBom.d.ts.map +1 -1
- package/types/lib/stages/postgen/introspection/annotate.d.ts +81 -0
- package/types/lib/stages/postgen/introspection/annotate.d.ts.map +1 -0
- package/types/lib/stages/postgen/introspection/commandFacts.d.ts +32 -0
- package/types/lib/stages/postgen/introspection/commandFacts.d.ts.map +1 -0
- package/types/lib/stages/postgen/introspection/emit.d.ts +71 -0
- package/types/lib/stages/postgen/introspection/emit.d.ts.map +1 -0
- package/types/lib/stages/postgen/introspection/formulationEvidence.d.ts +154 -0
- package/types/lib/stages/postgen/introspection/formulationEvidence.d.ts.map +1 -0
- package/types/lib/stages/postgen/introspection/markers.d.ts +58 -0
- package/types/lib/stages/postgen/introspection/markers.d.ts.map +1 -0
- package/types/lib/stages/postgen/introspection/reflect.d.ts +77 -0
- package/types/lib/stages/postgen/introspection/reflect.d.ts.map +1 -0
- package/types/lib/stages/postgen/introspection/report.d.ts +85 -0
- package/types/lib/stages/postgen/introspection/report.d.ts.map +1 -0
- package/types/lib/stages/postgen/introspection/score.d.ts +149 -0
- package/types/lib/stages/postgen/introspection/score.d.ts.map +1 -0
- package/types/lib/stages/postgen/introspection/shapeCommand.d.ts +79 -0
- package/types/lib/stages/postgen/introspection/shapeCommand.d.ts.map +1 -0
- package/types/lib/stages/postgen/parentEdge.d.ts +35 -0
- package/types/lib/stages/postgen/parentEdge.d.ts.map +1 -0
- package/types/lib/stages/postgen/postgen.d.ts +35 -2
- 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/pregen/envAudit.d.ts.map +1 -1
- package/types/lib/stages/pregen/pregen.d.ts +131 -0
- package/types/lib/stages/pregen/pregen.d.ts.map +1 -1
- package/types/lib/validator/bomValidator.d.ts.map +1 -1
package/types/lib/core/env.d.ts
CHANGED
|
@@ -60,7 +60,11 @@ export declare function getJavaCommand(): string;
|
|
|
60
60
|
export declare const PYTHON_CMD: string;
|
|
61
61
|
/**
|
|
62
62
|
* Returns the Python executable command to use, resolved in priority order:
|
|
63
|
-
* PYTHON_CMD env var > CONDA_PYTHON_EXE env var > "python".
|
|
63
|
+
* PYTHON_CMD env var > CONDA_PYTHON_EXE env var > "python" > "python3".
|
|
64
|
+
*
|
|
65
|
+
* Distributions that ship only a versioned interpreter leave a bare "python"
|
|
66
|
+
* unresolvable, which would fail every virtualenv this tool creates, so the
|
|
67
|
+
* versioned name is used when it is the only one PATH offers.
|
|
64
68
|
*
|
|
65
69
|
* @returns {string} Path or name of the Python executable
|
|
66
70
|
*/
|
|
@@ -81,6 +85,15 @@ export declare let RUSTC_CMD: string;
|
|
|
81
85
|
export declare let GO_CMD: string;
|
|
82
86
|
/** Resolved Cargo executable command (CARGO_CMD env var, or "cargo"). */
|
|
83
87
|
export declare let CARGO_CMD: string;
|
|
88
|
+
/**
|
|
89
|
+
* Target triple the cargo resolve graph is filtered to, so that a
|
|
90
|
+
* cross-compiled project can be described for the triple it ships on rather
|
|
91
|
+
* than for the union of every triple its lock file covers.
|
|
92
|
+
*
|
|
93
|
+
* `CDXGEN_CARGO_TARGET` is cdxgen's own name for it; `CARGO_BUILD_TARGET` is
|
|
94
|
+
* cargo's standard variable, which a cross-compiling build already sets.
|
|
95
|
+
*/
|
|
96
|
+
export declare const CARGO_TARGET: string | undefined;
|
|
84
97
|
/** Resolved Clojure CLI executable command (CLJ_CMD env var, or "clj"). */
|
|
85
98
|
export declare let CLJ_CMD: string;
|
|
86
99
|
/** Resolved Leiningen executable command (LEIN_CMD env var, or "lein"). */
|
|
@@ -105,6 +118,7 @@ export declare const PROJECT_TYPE_ALIASES: {
|
|
|
105
118
|
js: string[];
|
|
106
119
|
mcp: string[];
|
|
107
120
|
"ai-skill": string[];
|
|
121
|
+
agentic: string[];
|
|
108
122
|
py: string[];
|
|
109
123
|
go: string[];
|
|
110
124
|
rust: string[];
|
|
@@ -114,6 +128,17 @@ export declare const PROJECT_TYPE_ALIASES: {
|
|
|
114
128
|
dart: string[];
|
|
115
129
|
haskell: string[];
|
|
116
130
|
elixir: string[];
|
|
131
|
+
erlang: string[];
|
|
132
|
+
julia: string[];
|
|
133
|
+
r: string[];
|
|
134
|
+
ocaml: string[];
|
|
135
|
+
elm: string[];
|
|
136
|
+
crystal: string[];
|
|
137
|
+
nim: string[];
|
|
138
|
+
lua: string[];
|
|
139
|
+
perl: string[];
|
|
140
|
+
spack: string[];
|
|
141
|
+
terraform: string[];
|
|
117
142
|
c: string[];
|
|
118
143
|
clojure: string[];
|
|
119
144
|
github: string[];
|
|
@@ -143,6 +168,23 @@ export declare const PROJECT_TYPE_ALIASES: {
|
|
|
143
168
|
export declare const PACKAGE_MANAGER_ALIASES: {
|
|
144
169
|
scala: string[];
|
|
145
170
|
};
|
|
171
|
+
/**
|
|
172
|
+
* Project-type prefixes that accept a version suffix pinning a JVM build
|
|
173
|
+
* tool, e.g. `maven3.9.9`, `mvn3.9.9`, `gradle8.14`, `sbt1.10`, or
|
|
174
|
+
* `scala3.6.4`. Kept alongside the alias map because both describe how CLI
|
|
175
|
+
* project types map to base types.
|
|
176
|
+
*
|
|
177
|
+
* @type {string[]}
|
|
178
|
+
*/
|
|
179
|
+
export declare const JVM_BUILD_TOOL_TYPE_PREFIXES: string[];
|
|
180
|
+
/**
|
|
181
|
+
* Check whether a project type pins a JVM build tool version, i.e. it starts
|
|
182
|
+
* with one of the JVM build tool prefixes followed by a digit.
|
|
183
|
+
*
|
|
184
|
+
* @param {string} projectType Project type from the CLI
|
|
185
|
+
* @returns {boolean} True for versioned JVM build tool types.
|
|
186
|
+
*/
|
|
187
|
+
export declare function isVersionedJvmToolProjectType(projectType: string): boolean;
|
|
146
188
|
/**
|
|
147
189
|
* Method to check if a given feature flag is enabled.
|
|
148
190
|
*
|
|
@@ -1 +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;AA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AO,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"}
|
package/types/lib/core/fs.d.ts
CHANGED
|
@@ -6,6 +6,15 @@ import { Buffer } from "node:buffer";
|
|
|
6
6
|
* @Boolean True if the path exists. False otherwise
|
|
7
7
|
*/
|
|
8
8
|
export declare function safeExistsSync(filePath: string): any;
|
|
9
|
+
/**
|
|
10
|
+
* Permission-aware check for whether a path exists and carries the executable
|
|
11
|
+
* bit for the current user. Answers false instead of throwing when the path
|
|
12
|
+
* is absent, unreadable, or blocked by secure mode.
|
|
13
|
+
*
|
|
14
|
+
* @param {string} filePath File path to check.
|
|
15
|
+
* @returns {boolean} True when the path exists and is executable.
|
|
16
|
+
*/
|
|
17
|
+
export declare function safeIsExecutableSync(filePath: string): boolean;
|
|
9
18
|
/**
|
|
10
19
|
* Permission- and dry-run-aware wrapper around writeFileSync. Records the
|
|
11
20
|
* activity and returns undefined when blocked.
|
|
@@ -16,6 +25,18 @@ export declare function safeExistsSync(filePath: string): any;
|
|
|
16
25
|
* @returns {void}
|
|
17
26
|
*/
|
|
18
27
|
export declare function safeWriteSync(filePath: string, data: string | Buffer, options?: Object): void;
|
|
28
|
+
/**
|
|
29
|
+
* Permission-aware wrapper around readFileSync that returns undefined instead
|
|
30
|
+
* of throwing. Reads are allowed in dry-run mode, so unlike the write wrappers
|
|
31
|
+
* this only guards secure-mode read permission; the read itself is not recorded
|
|
32
|
+
* in the activity ledger because inspection of classified paths is already
|
|
33
|
+
* recorded by safeExistsSync and a read has no side effect to audit.
|
|
34
|
+
*
|
|
35
|
+
* @param {string} filePath File path to read.
|
|
36
|
+
* @param {Object|string} [options] readFileSync options; defaults to UTF-8 text.
|
|
37
|
+
* @returns {string|Buffer|undefined} File content, or undefined when the path cannot be read.
|
|
38
|
+
*/
|
|
39
|
+
export declare function safeReadFileSync(filePath: string, options?: Object | string): string | Buffer | undefined;
|
|
19
40
|
/**
|
|
20
41
|
* Safely create a directory without crashing due to a lack of permissions
|
|
21
42
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fs.d.ts","sourceRoot":"","sources":["../../../lib/core/fs.js"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"fs.d.ts","sourceRoot":"","sources":["../../../lib/core/fs.js"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAyErC;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,QAAQ,QAAA,OAmCtC;AAED;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAHlC,MAGkC,GAFhC,OAAO,CAYnB;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;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAJ9B,MAI8B,EAAE,OAAO,AAH/C,CACA,EADQ,MAAM,GAAC,MAG0C,GAF/C,MAAM,GAAC,MAAM,GAAC,SAAS,CA0BnC;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,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P,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"}
|
|
@@ -1,14 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
*
|
|
4
|
-
* Exported so that the live region and the table renderer resolve the same
|
|
5
|
-
* destination as the loggers do. A caller that sets `CDXGEN_LOG_STREAM=stdout`
|
|
6
|
-
* gets the pre-v13 behaviour for all of it, not just for the thought and trace
|
|
7
|
-
* logs.
|
|
8
|
-
*
|
|
9
|
-
* @type {NodeJS.WritableStream}
|
|
10
|
-
*/
|
|
11
|
-
export declare const diagnosticStream: NodeJS.WritableStream;
|
|
1
|
+
import { diagnosticStream } from "./syncFileWriter.js";
|
|
2
|
+
export { diagnosticStream };
|
|
12
3
|
/** True when thought/reasoning logging is enabled (CDXGEN_THOUGHT_LOG, CDXGEN_THINK_MODE, or verbose debug mode). */
|
|
13
4
|
export declare const THINK_MODE: any;
|
|
14
5
|
/** True when structured command/HTTP trace logging is enabled (CDXGEN_TRACE_LOG, CDXGEN_TRACE_ID, CDXGEN_TRACE_MODE, or verbose debug mode). */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../../lib/core/logger.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../../lib/core/logger.js"],"names":[],"mappings":"AAGA,OAAO,EAEL,gBAAgB,EAEjB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,gBAAgB,EAAE,CAAC;AAY5B,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;AAGD;;;;;;GAMG;AACH,wBAAgB,UAAU,IAFb,IAAI,CAQhB;AAuCD;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,SAAS,QAAA,EAAE,IAAI,EAF7B,MAE6B,QAyBvC;AAID;;;;;;;;GAQG;AACH,wBAAgB,eAAe,IAFlB,IAAI,CAShB"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared severity ordering for finding and confidence ladders.
|
|
3
|
+
*
|
|
4
|
+
* Lives in the core layer so modules below the audit layer can order labels
|
|
5
|
+
* such as `low`/`medium`/`high` without importing the audit package; the audit
|
|
6
|
+
* scoring module re-exports this constant under its historical name.
|
|
7
|
+
*
|
|
8
|
+
* @type {Readonly<Record<string, number>>}
|
|
9
|
+
*/
|
|
10
|
+
export declare const SEVERITY_ORDER: Readonly<Record<string, number>>;
|
|
11
|
+
//# sourceMappingURL=severity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"severity.d.ts","sourceRoot":"","sources":["../../../lib/core/severity.js"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,eAAO,MAAM,cAAc,EAFjB,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAQvC,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Writable } from "node:stream";
|
|
2
|
+
/**
|
|
3
|
+
* The stream every human-readable diagnostic is written to.
|
|
4
|
+
*
|
|
5
|
+
* Also the fallback destination of {@link openSyncFileWriter} when a log path
|
|
6
|
+
* cannot be opened, so an unwritable path keeps the records visible somewhere
|
|
7
|
+
* instead of taking the run down.
|
|
8
|
+
*
|
|
9
|
+
* @type {NodeJS.WritableStream}
|
|
10
|
+
*/
|
|
11
|
+
export declare const diagnosticStream: NodeJS.WritableStream;
|
|
12
|
+
/**
|
|
13
|
+
* Open a synchronous writer for a log file path, or return the writer already
|
|
14
|
+
* open for that path.
|
|
15
|
+
*
|
|
16
|
+
* `Console` requires a real stream, so this is a `Writable` whose `_write`
|
|
17
|
+
* completes synchronously: bytes reach the descriptor as each record is
|
|
18
|
+
* written, and nothing is left queued for an event loop turn that a process
|
|
19
|
+
* exit may never take.
|
|
20
|
+
*
|
|
21
|
+
* @param {string} filePath Destination path
|
|
22
|
+
* @param {NodeJS.WritableStream|null} [fallbackStream] Stream returned when the path cannot be opened; defaults to the diagnostic stream. Pass `null` to get `undefined` instead, for callers that must never let data records spill into a diagnostic stream.
|
|
23
|
+
* @returns {Writable|NodeJS.WritableStream|undefined} Writer for the path, the fallback stream, or `undefined` when the path cannot be opened and no fallback was requested
|
|
24
|
+
*/
|
|
25
|
+
export declare function openSyncFileWriter(filePath: string, fallbackStream?: NodeJS.WritableStream | null): Writable | NodeJS.WritableStream | undefined;
|
|
26
|
+
/**
|
|
27
|
+
* Close every synchronous file writer opened by {@link openSyncFileWriter}.
|
|
28
|
+
* Safe to call more than once and after individual writers were closed.
|
|
29
|
+
*
|
|
30
|
+
* @returns {void}
|
|
31
|
+
*/
|
|
32
|
+
export declare function closeAllSyncFileWriters(): void;
|
|
33
|
+
//# sourceMappingURL=syncFileWriter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"syncFileWriter.d.ts","sourceRoot":"","sources":["../../../lib/core/syncFileWriter.js"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAOvC;;;;;;;;GAQG;AACH,eAAO,MAAM,gBAAgB,EAFnB,qBAGoE,CAAC;AAS/E;;;;;;;;;;;;GAYG;AACH,wBAAgB,kBAAkB,CAChC,QAAQ,EALC,MAKD,EACR,cAAc,AALb,CACA,EADQ,qBAAqB,GAAC,IAKE,GAJtB,QAAQ,GAAC,qBAAqB,GAAC,SAAS,CAsDpD;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,IAF1B,IAAI,CAMhB"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Outbound `user-agent` construction.
|
|
3
|
+
*
|
|
4
|
+
* Package registries police automated traffic through this header, and their
|
|
5
|
+
* requirements differ. GitHub rejects an absent one with a 403; crates.io
|
|
6
|
+
* rejects an absent one and additionally blocks a configurable list of exact
|
|
7
|
+
* strings and prefixes at the CDN edge; Packagist asks for a `mailto=` contact;
|
|
8
|
+
* PyPI asks for a value that uniquely identifies the consumer, with contact
|
|
9
|
+
* information; pub.dev documents a `name/version (+url)` shape. The default
|
|
10
|
+
* built here satisfies all of them at once.
|
|
11
|
+
*
|
|
12
|
+
* Two escape hatches exist for operators whose traffic a registry has taken
|
|
13
|
+
* issue with: `CDXGEN_USER_AGENT` replaces the header everywhere, and
|
|
14
|
+
* `CDXGEN_USER_AGENT_<REGISTRY>` replaces it for one destination.
|
|
15
|
+
*/
|
|
16
|
+
/**
|
|
17
|
+
* The registry key covering a host, if any.
|
|
18
|
+
*
|
|
19
|
+
* @param {String} hostname Lower-case hostname of the request
|
|
20
|
+
* @returns {String|undefined} Registry key such as `CRATES`, or undefined
|
|
21
|
+
*/
|
|
22
|
+
export declare function registryKeyForHost(hostname: string): string | undefined;
|
|
23
|
+
/**
|
|
24
|
+
* The default user-agent: `cdxgen/<version> (+<home url>; mailto=<address>)`.
|
|
25
|
+
* Setting CDXGEN_CONTACT_EMAIL substitutes a different address, which is what
|
|
26
|
+
* an operator running cdxgen at scale should do so that a registry contacts
|
|
27
|
+
* them rather than the project.
|
|
28
|
+
*
|
|
29
|
+
* The `@scope/name` npm spelling is deliberately avoided. crates.io blocks
|
|
30
|
+
* user-agents beginning `@CycloneDX/cdxgen` outright, and a leading `@` is
|
|
31
|
+
* unusual enough elsewhere to invite the same treatment.
|
|
32
|
+
*
|
|
33
|
+
* @returns {String} Default user-agent for outbound requests
|
|
34
|
+
*/
|
|
35
|
+
export declare function defaultUserAgent(): string;
|
|
36
|
+
/**
|
|
37
|
+
* The user-agent to send to a host. A `CDXGEN_USER_AGENT_<REGISTRY>` override
|
|
38
|
+
* wins for the hosts of that registry, then the global `CDXGEN_USER_AGENT`,
|
|
39
|
+
* then the default. Blank overrides are ignored: several registries reject an
|
|
40
|
+
* empty header outright, so falling back is safer than honouring it.
|
|
41
|
+
*
|
|
42
|
+
* @param {String} [hostname] Hostname the request is bound for
|
|
43
|
+
* @returns {String} User-agent header value
|
|
44
|
+
*/
|
|
45
|
+
export declare function getUserAgent(hostname?: string): string;
|
|
46
|
+
/**
|
|
47
|
+
* Whether a user-agent carries a substring that crates.io blocks. Useful for
|
|
48
|
+
* warning an operator whose override would be refused there.
|
|
49
|
+
*
|
|
50
|
+
* @param {String} userAgent User-agent value to test
|
|
51
|
+
* @returns {String|undefined} The offending substring, or undefined
|
|
52
|
+
*/
|
|
53
|
+
export declare function blockedUserAgentSubstring(userAgent: string): string | undefined;
|
|
54
|
+
/** Registry keys that `CDXGEN_USER_AGENT_<REGISTRY>` accepts. */
|
|
55
|
+
export declare const USER_AGENT_REGISTRY_KEYS: readonly string[];
|
|
56
|
+
//# sourceMappingURL=userAgent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"userAgent.d.ts","sourceRoot":"","sources":["../../../lib/core/userAgent.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAwDH;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,QAAA,GAF9B,SAAO,SAAS,CAe5B;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,gBAAgB,WAI/B;AAED;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAAC,QAAQ,AAHlC,CACA,QAEkC,UAUpC;AAED;;;;;;GAMG;AACH,wBAAgB,yBAAyB,CAAC,SAAS,QAAA,GAFtC,SAAO,SAAS,CAU5B;AAED,iEAAiE;AACjE,eAAO,MAAM,wBAAwB,mBAEpC,CAAC"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
export type CargoCacheMetadata = {
|
|
2
|
+
/**
|
|
3
|
+
* Crate description.
|
|
4
|
+
*/
|
|
5
|
+
description?: string;
|
|
6
|
+
/**
|
|
7
|
+
* SPDX license expression.
|
|
8
|
+
*/
|
|
9
|
+
license?: string;
|
|
10
|
+
/**
|
|
11
|
+
* Source repository URL.
|
|
12
|
+
*/
|
|
13
|
+
repository?: string;
|
|
14
|
+
/**
|
|
15
|
+
* Homepage URL.
|
|
16
|
+
*/
|
|
17
|
+
homepage?: string;
|
|
18
|
+
/**
|
|
19
|
+
* Minimum supported Rust version.
|
|
20
|
+
*/
|
|
21
|
+
rustVersion?: string;
|
|
22
|
+
/**
|
|
23
|
+
* SHA-256 of the published `.crate` archive.
|
|
24
|
+
*/
|
|
25
|
+
checksum?: string;
|
|
26
|
+
/**
|
|
27
|
+
* Feature table.
|
|
28
|
+
*/
|
|
29
|
+
features?: Object;
|
|
30
|
+
/**
|
|
31
|
+
* Whether this version was yanked.
|
|
32
|
+
*/
|
|
33
|
+
yanked?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* RFC 3339 publish timestamp.
|
|
36
|
+
*/
|
|
37
|
+
publishTime?: string;
|
|
38
|
+
/**
|
|
39
|
+
* Newest non-yanked version in the index.
|
|
40
|
+
*/
|
|
41
|
+
latestVersion?: string;
|
|
42
|
+
/**
|
|
43
|
+
* Which local files answered, for provenance.
|
|
44
|
+
*/
|
|
45
|
+
sources: string[];
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* Reset memoized state. Tests that point `CARGO_HOME` at a fixture need the
|
|
49
|
+
* next call to look again rather than reuse the previous run's answer.
|
|
50
|
+
*
|
|
51
|
+
* @returns {void}
|
|
52
|
+
*/
|
|
53
|
+
export declare function resetCargoCacheState(): void;
|
|
54
|
+
/**
|
|
55
|
+
* Whether the local registry should be consulted before crates.io.
|
|
56
|
+
*
|
|
57
|
+
* @returns {boolean} false when `CARGO_METADATA_SOURCE=registry` opts out.
|
|
58
|
+
*/
|
|
59
|
+
export declare function localCargoMetadataEnabled(): boolean;
|
|
60
|
+
/**
|
|
61
|
+
* Resolve the Cargo registry root.
|
|
62
|
+
*
|
|
63
|
+
* @returns {string} Absolute path to `$CARGO_HOME/registry`.
|
|
64
|
+
*/
|
|
65
|
+
export declare function getCargoRegistryDir(): string;
|
|
66
|
+
/**
|
|
67
|
+
* Read everything the local registry knows about one crate version.
|
|
68
|
+
*
|
|
69
|
+
* @param {string} name Crate name.
|
|
70
|
+
* @param {string} version Exact version.
|
|
71
|
+
* @returns {CargoCacheMetadata|undefined} Metadata, or undefined when neither
|
|
72
|
+
* local source has this crate.
|
|
73
|
+
*/
|
|
74
|
+
export declare function readCargoCacheMetadata(name: string, version: string): CargoCacheMetadata | undefined;
|
|
75
|
+
//# sourceMappingURL=cargoCache.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cargoCache.d.ts","sourceRoot":"","sources":["../../../lib/ecosystems/cargoCache.js"],"names":[],"mappings":"AAsCG,YAAkB,kBAAkB,GACpC;;;;IAAoB,WAAW,AAA/B,CACA,EADW,MAAM,CACjB;;;;IAAoB,OAAO,AAA3B,CACA,EADW,MAAM,CACjB;;;;IAAoB,UAAU,AAA9B,CACA,EADW,MAAM,CACjB;;;;IAAoB,QAAQ,AAA5B,CACA,EADW,MAAM,CACjB;;;;IAAoB,WAAW,AAA/B,CACA,EADW,MAAM,CACjB;;;;IAAoB,QAAQ,AAA5B,CACA,EADW,MAAM,CACjB;;;;IAAoB,QAAQ,AAA5B,CACA,EADW,MAAM,CACjB;;;;IAAqB,MAAM,AAA3B,CACA,EADW,OAAO,CAClB;;;;IAAoB,WAAW,AAA/B,CACA,EADW,MAAM,CACjB;;;;IAAoB,aAAa,AAAjC,CACA,EADW,MAAM,CACjB;;;;IAAqB,OAAO,EAAjB,MAAM,EAAE,CACrB;CAAA,CAAA;AAUD;;;;;GAKG;AACH,wBAAgB,oBAAoB,IAFvB,IAAI,CAKhB;AAED;;;;GAIG;AACH,wBAAgB,yBAAyB,IAF5B,OAAO,CAOnB;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,IAFtB,MAAM,CAOlB;AAkCD;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,EALhC,MAKgC,EAAE,OAAO,EAJzC,MAIyC,GAHvC,kBAAkB,GAAC,SAAS,CA0BxC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"caxa.d.ts","sourceRoot":"","sources":["../../../lib/ecosystems/caxa.js"],"names":[],"mappings":"AAMA;;;;;GAKG;AACH,wBAAsB,iBAAiB,CAAC,KAAK,EAHlC,MAGkC,GAFhC,OAAO,CAAC,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"caxa.d.ts","sourceRoot":"","sources":["../../../lib/ecosystems/caxa.js"],"names":[],"mappings":"AAMA;;;;;GAKG;AACH,wBAAsB,iBAAiB,CAAC,KAAK,EAHlC,MAGkC,GAFhC,OAAO,CAAC,MAAM,CAAC,CA0E3B"}
|
|
@@ -17,9 +17,9 @@ export declare function getCppModules(src: string, options: object, osPkgsList:
|
|
|
17
17
|
"bom-ref": string;
|
|
18
18
|
group?: undefined;
|
|
19
19
|
} | {
|
|
20
|
+
purl?: undefined;
|
|
20
21
|
description?: undefined;
|
|
21
22
|
license?: undefined;
|
|
22
|
-
purl?: undefined;
|
|
23
23
|
"bom-ref"?: undefined;
|
|
24
24
|
group: any;
|
|
25
25
|
name: any;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cppEvidence.d.ts","sourceRoot":"","sources":["../../../lib/ecosystems/cppEvidence.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"cppEvidence.d.ts","sourceRoot":"","sources":["../../../lib/ecosystems/cppEvidence.js"],"names":[],"mappings":"AAgCA;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,GAAG,EALtB,MAKsB,EAAE,OAAO,EAJ/B,MAI+B,EAAE,UAAU,EAH3C,KAG2C,EAAE,QAAQ,EAFrD,KAEqD;;;;;;;;;;;;;;;;;;;;;;;;;EA8S/D"}
|
|
@@ -236,9 +236,23 @@ export declare function getGoPkgVCSUrl(group: string, name: string): Promise<any
|
|
|
236
236
|
/**
|
|
237
237
|
* Method to retrieve metadata for rust packages by querying crates
|
|
238
238
|
*
|
|
239
|
+
* The local Cargo registry is consulted first, because crates.io's crawler
|
|
240
|
+
* policy allows one request per second and a populated `~/.cargo` already
|
|
241
|
+
* holds the license, description, repository, checksum and yanked flag for
|
|
242
|
+
* every crate the build compiled.
|
|
243
|
+
*
|
|
244
|
+
* What it does not hold is publisher identity, so a caller that needs the
|
|
245
|
+
* publisher-drift and release-cadence signals — the predictive audit does —
|
|
246
|
+
* passes `preferLocalCache: false` and takes the slower registry path.
|
|
247
|
+
*
|
|
239
248
|
* @param {Array} pkgList Package list
|
|
249
|
+
* @param {Object} [options] Options
|
|
250
|
+
* @param {boolean} [options.preferLocalCache=true] Answer from the local Cargo
|
|
251
|
+
* registry where it can, and query crates.io only for the rest.
|
|
240
252
|
*/
|
|
241
|
-
export declare function getCratesMetadata(pkgList: any[]
|
|
253
|
+
export declare function getCratesMetadata(pkgList: any[], options?: {
|
|
254
|
+
preferLocalCache?: boolean;
|
|
255
|
+
}): Promise<any[]>;
|
|
242
256
|
/**
|
|
243
257
|
* Method to retrieve metadata for dart packages by querying pub.dev
|
|
244
258
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ecosystems.d.ts","sourceRoot":"","sources":["../../../lib/ecosystems/ecosystems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The combined output for all subprojects of the Gradle properties task
|
|
59
59
|
*/
|
|
60
60
|
export declare function executeParallelGradleProperties(dir: string, allProjectsStr: array, extraArgs?: array): string;
|
|
61
|
+
/**
|
|
62
|
+
* Forget the causes diagnosed so far, so a process that generates more than
|
|
63
|
+
* one BOM diagnoses each run on its own.
|
|
64
|
+
*
|
|
65
|
+
* @returns {void}
|
|
66
|
+
*/
|
|
67
|
+
export declare function resetGradleFailureCauses(): void;
|
|
68
|
+
/**
|
|
69
|
+
* Whether a gradle invocation has already failed outright this run, so a
|
|
70
|
+
* caller can skip reporting a consequence of that failure as its own
|
|
71
|
+
* degradation.
|
|
72
|
+
*
|
|
73
|
+
* @returns {boolean} True once an invocation failure has been recorded.
|
|
74
|
+
*/
|
|
75
|
+
export declare function hasGradleInvocationFailure(): boolean;
|
|
76
|
+
/**
|
|
77
|
+
* Record why a gradle invocation failed. Every failure also records the
|
|
78
|
+
* `jvm.gradle.invocation-failed` degradation so the reflection can rank the
|
|
79
|
+
* repair; version-incompatibility causes additionally record a
|
|
80
|
+
* `tool.mismatch` event naming the versions, which is the fact the report
|
|
81
|
+
* cannot derive from an empty BOM alone. Diagnosis events are recorded once
|
|
82
|
+
* per cause per run; the degradation dedupes in the reflection by id.
|
|
83
|
+
*
|
|
84
|
+
* @param {Object} result The spawnSync result of the failed invocation.
|
|
85
|
+
* @param {Object} context Call-site facts.
|
|
86
|
+
* @param {string} [context.command] The redacted command that was attempted.
|
|
87
|
+
* @param {string} [context.gradleVersion] The gradle version in play, when the caller knows it.
|
|
88
|
+
* @returns {void}
|
|
89
|
+
*/
|
|
90
|
+
export declare function recordGradleInvocationFailure(result: Object, context?: {
|
|
91
|
+
command?: string;
|
|
92
|
+
gradleVersion?: string;
|
|
93
|
+
}): void;
|
|
61
94
|
/**
|
|
62
95
|
* Method to resolve dependencies from a gradle output
|
|
63
96
|
*
|
|
@@ -136,4 +169,24 @@ export declare function getMillCommand(srcPath: string): string;
|
|
|
136
169
|
* @param {string} rootPath Root directory to look for maven wrapper
|
|
137
170
|
*/
|
|
138
171
|
export declare function getMavenCommand(srcPath: string, rootPath: string): string;
|
|
172
|
+
/**
|
|
173
|
+
* Parse a Gradle version catalog (`gradle/libs.versions.toml`).
|
|
174
|
+
*
|
|
175
|
+
* A catalog declares coordinates the build scripts then reference by alias.
|
|
176
|
+
* It is a declaration, not a resolution: entries may go unused, and their
|
|
177
|
+
* versions may be references into the `[versions]` table. Because of that,
|
|
178
|
+
* catalog components are emitted only as a fallback when Gradle itself
|
|
179
|
+
* produced no dependency information, and every component carries a
|
|
180
|
+
* `cdx:gradle:catalog=true` property so consumers can tell declared catalog
|
|
181
|
+
* entries from a resolved graph.
|
|
182
|
+
*
|
|
183
|
+
* Only libraries whose version resolves to a literal (inline or via
|
|
184
|
+
* `version.ref`) are emitted; rich or unresolved versions would produce purls
|
|
185
|
+
* that identify no artifact. Plugins are skipped because they are build-time
|
|
186
|
+
* only.
|
|
187
|
+
*
|
|
188
|
+
* @param {string} catalogFile Path to `libs.versions.toml`
|
|
189
|
+
* @returns {Object[]} Package records for resolvable library entries
|
|
190
|
+
*/
|
|
191
|
+
export declare function parseGradleVersionCatalog(catalogFile: string): Object[];
|
|
139
192
|
//# sourceMappingURL=gradleutils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gradleutils.d.ts","sourceRoot":"","sources":["../../../lib/ecosystems/gradleutils.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"gradleutils.d.ts","sourceRoot":"","sources":["../../../lib/ecosystems/gradleutils.js"],"names":[],"mappings":"AAwCA;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAH7B,MAG6B,EAAE,QAAQ,EAFvC,MAAM,GAAC,IAEgC,UA2FjD;AAED;;;;;;;;;GASG;AACH,wBAAgB,2BAA2B,CACzC,eAAe,EARN,MAAM,EAQA,EACf,iBAAiB,EARR,MAAM,EAQE,EACjB,yBAAyB,EARhB,MAAM,EAQU,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C,MAAM,CAuBlB;AAED;;;;;GAKG;AACH,wBAAgB,0BAA0B,CAAC,MAAM,EAHtC,MAGsC,GAFpC,MAAM,CA8ClB;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAsB,yBAAyB,CAC7C,UAAU,EAPD,MAOC,EACV,SAAS,EAPA,MAOA,EACT,QAAQ,GAPC,OAOM,EAAE,qCAAqC;AACtD,gBAAgB,GAPP,OAOe,GANb,OAAO,CAAC,MAAM,CAAC,CAgC3B;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAF3B,MAE2B,UAcrC;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAH5B,MAG4B,EAAE,QAAQ,EAFtC,MAEsC,UA6JhD;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,yBAAyB,CAAC,WAAW,EAH1C,MAG0C,GAFxC,MAAM,EAAE,CAoEpB"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
export declare function isKosiKotlinLanguage(language: any): boolean;
|
|
2
|
+
/**
|
|
3
|
+
* True when kosi is disabled by CDXGEN_KOSI_DISABLE (1/all/true) or --no-kosi.
|
|
4
|
+
* The check happens before any binary resolution so a disabled run never
|
|
5
|
+
* even looks for the plugin.
|
|
6
|
+
*/
|
|
7
|
+
export declare function kosiDisabled(): any;
|
|
8
|
+
/**
|
|
9
|
+
* Orchestrates the kosi runs over src and returns the parsed reports: one
|
|
10
|
+
* `all` pass (every slice kind, dependency tier) and one `reachable` pass
|
|
11
|
+
* (call-graph reachability from the roots). The analysis is read-only and
|
|
12
|
+
* offline: kosi never executes the project's build. A classpath.txt beside
|
|
13
|
+
* the sources (the documented build-tool report) is passed through when
|
|
14
|
+
* present.
|
|
15
|
+
*
|
|
16
|
+
* @param {string} src Directory to analyze.
|
|
17
|
+
* @param {Object} options Configuration options.
|
|
18
|
+
* @returns {Object|undefined} { report, reachableReport } or undefined.
|
|
19
|
+
*/
|
|
20
|
+
export declare function analyzeKosiProject(src: string, options?: Object): Object | undefined;
|
|
21
|
+
/**
|
|
22
|
+
* Merges the reachable pass's evidence into the all pass's maps, mutating
|
|
23
|
+
* the first argument.
|
|
24
|
+
*
|
|
25
|
+
* The reachable pass's slices are the all pass's INTERSECTED with call-graph
|
|
26
|
+
* reachability from the roots, so every key it produces is a key the all pass
|
|
27
|
+
* already has, and the unions below cannot add one. That made the second full
|
|
28
|
+
* `--backend resolved --deps` analysis — the most expensive thing this arm
|
|
29
|
+
* runs, and it runs it twice — contribute exactly nothing: the one fact it
|
|
30
|
+
* computes, reachability, was discarded at the merge (the P23 review's R144).
|
|
31
|
+
* It is recorded now, on the components whose evidence survived the
|
|
32
|
+
* intersection, which is the signal an SBOM consumer prioritises with. kosi's
|
|
33
|
+
* own schema deliberately stopped carrying `reachableFromRoots` per slice in
|
|
34
|
+
* P22 because there it was a mode-level fact wearing a per-slice field's
|
|
35
|
+
* clothes; here it is neither, it is the measured difference between two runs.
|
|
36
|
+
*/
|
|
37
|
+
export declare function mergeKosiEvidence(all: any, reachable: any): any;
|
|
38
|
+
/**
|
|
39
|
+
* Services evidence: kosi's outbound services[] rows are already
|
|
40
|
+
* CycloneDX-shaped.
|
|
41
|
+
*/
|
|
42
|
+
export declare function collectKosiServices(kosiReport?: {}, servicesMap?: {}): {};
|
|
43
|
+
/**
|
|
44
|
+
* INBOUND endpoints: kosi's apiEndpoints[] rows are the routes the analysed
|
|
45
|
+
* application itself serves, which `services[]` (kosi's OUTBOUND calls)
|
|
46
|
+
* does not carry. Without this the whole inbound surface — the path
|
|
47
|
+
* template, the framework that declared it, and above all whether anything
|
|
48
|
+
* authenticates it — stopped at the kosi report and never reached the
|
|
49
|
+
* SaaSBOM.
|
|
50
|
+
*
|
|
51
|
+
* One service per endpoint, named the way detectServicesFromOpenAPI names
|
|
52
|
+
* its own (`service-<path>-<method>`), so an OpenAPI spec and a kosi run
|
|
53
|
+
* over the same route converge on one entry instead of two.
|
|
54
|
+
*
|
|
55
|
+
* `authenticated` is left UNDEFINED when the endpoint declares no
|
|
56
|
+
* authentication: kosi's empty list means "nothing was declared here",
|
|
57
|
+
* which is not the same claim as "this route is unauthenticated", and
|
|
58
|
+
* cdxgen's own detectors use undefined for exactly that unknown.
|
|
59
|
+
*
|
|
60
|
+
* @param {Object} kosiReport The parsed JSON generated by kosi.
|
|
61
|
+
* @param {Object} servicesMap Map populated with detected service definitions
|
|
62
|
+
* @returns {Object} The mutated services map
|
|
63
|
+
*/
|
|
64
|
+
export declare function collectKosiApiEndpoints(kosiReport?: Object, servicesMap?: Object): Object;
|
|
65
|
+
export declare function collectKosiEvidence(kosiReport?: {}, components?: any[]): {
|
|
66
|
+
componentPropertiesMap: {};
|
|
67
|
+
cryptoComponents: any[];
|
|
68
|
+
cryptoGeneratePurls: {};
|
|
69
|
+
dataFlowFrames: {};
|
|
70
|
+
metadataProperties: any[];
|
|
71
|
+
purlLocationMap: {};
|
|
72
|
+
};
|
|
73
|
+
//# sourceMappingURL=kosi.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kosi.d.ts","sourceRoot":"","sources":["../../../lib/ecosystems/kosi.js"],"names":[],"mappings":"AA+BA,wBAAgB,oBAAoB,CAAC,QAAQ,KAAA,WAE5C;AAED;;;;GAIG;AACH,wBAAgB,YAAY,QAQ3B;AA6DD;;;;;;;;;;;GAWG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAJ3B,MAI2B,EAAE,OAAO,GAHpC,MAGyC,GAFvC,MAAM,GAAC,SAAS,CAkD5B;AA0BD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,KAAA,EAAE,SAAS,KAAA,OA4B/C;AAusBD;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,UAAU,KAAK,EAAE,WAAW,KAAK,MAsEpE;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,uBAAuB,CAAC,UAAU,GAJvC,MAI4C,EAAE,WAAW,GAHzD,MAG8D,GAF5D,MAAM,CAoFlB;AAiCD,wBAAgB,mBAAmB,CAAC,UAAU,KAAK,EAAE,UAAU,QAAK;;;;;;;EA2DnE"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Crystal parser for `shard.yml` and `shard.lock`.
|
|
3
|
+
*
|
|
4
|
+
* Shards resolves dependencies declared in `shard.yml` and records the
|
|
5
|
+
* resolved set in `shard.lock`, which pins each dependency's version and
|
|
6
|
+
* source repository. Both files are YAML and are read with the standard
|
|
7
|
+
* parser.
|
|
8
|
+
*
|
|
9
|
+
* No `crystal` purl type is registered, so shards are identified as generic
|
|
10
|
+
* packages carrying a `cdx:purl:proposedType=crystal` property, following
|
|
11
|
+
* the convention used for nix and zig. This keeps the BOM valid today and
|
|
12
|
+
* allows a mechanical migration if a type is registered upstream.
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* Parse a Crystal project from `shard.yml` and optional `shard.lock`.
|
|
16
|
+
*
|
|
17
|
+
* @param {string} shardYmlFile Path to `shard.yml`
|
|
18
|
+
* @param {string} [shardLockFile] Path to `shard.lock`, if present
|
|
19
|
+
* @returns {{ pkgList: object[], dependencies: object[], parentComponent: object, rootInputs?: string[] }}
|
|
20
|
+
*/
|
|
21
|
+
export declare function parseShardsProject(shardYmlFile: string, shardLockFile?: string): {
|
|
22
|
+
pkgList: object[];
|
|
23
|
+
dependencies: object[];
|
|
24
|
+
parentComponent: object;
|
|
25
|
+
rootInputs?: string[];
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=parsers-crystal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parsers-crystal.d.ts","sourceRoot":"","sources":["../../../lib/ecosystems/parsers-crystal.js"],"names":[],"mappings":"AAMA;;;;;;;;;;;;GAYG;AAEH;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,YAAY,EAJpC,MAIoC,EAAE,aAAa,AAH3D,CACA,EADQ,MAGmD,GAFjD;IAAE,OAAO,EAAE,MAAM,EAAE,CAAC;IAAC,YAAY,EAAE,MAAM,EAAE,CAAC;IAAC,eAAe,EAAE,MAAM,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,EAAE,CAAA;CAAE,CA6FzG"}
|
|
@@ -1,3 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Apply a version to a NuGet component so that the `version` field and the purl
|
|
3
|
+
* always agree.
|
|
4
|
+
*
|
|
5
|
+
* A .NET manifest can state a version that is not a version: an MSBuild property
|
|
6
|
+
* such as `$(JsonVersion)`, a range such as `[3.13.3,4.0)`, a wildcard such as
|
|
7
|
+
* `2.0.*`, or nothing at all. Such a declaration cannot go into a purl, so a
|
|
8
|
+
* component that kept it in `version` while its purl carried none described one
|
|
9
|
+
* package two ways. A scanner range matching on the versionless purl then reports
|
|
10
|
+
* every advisory published against the package name.
|
|
11
|
+
*
|
|
12
|
+
* The declaration is not lost: callers record it as `cdx:nuget:declared_version_range`.
|
|
13
|
+
*
|
|
14
|
+
* @param {Object} pkg Component to update in place. `name` must already be set.
|
|
15
|
+
* @param {String} [version] Version as stated or resolved, concrete or not
|
|
16
|
+
*
|
|
17
|
+
* @returns {Object} The same component
|
|
18
|
+
*/
|
|
19
|
+
export declare function applyNugetVersion(pkg: Object, version?: string): Object;
|
|
1
20
|
/**
|
|
2
21
|
* Method to parse .nupkg files
|
|
3
22
|
*
|