@cdxgen/cdxgen 13.0.1 → 13.1.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 +26 -13
- package/bin/audit.js +6 -0
- package/bin/cdxgen.js +125 -4
- package/bin/evinse.js +1 -1
- package/data/component-tags.json +8 -1
- package/data/frameworks-list.json +86 -1
- package/data/remediations.json +1144 -0
- package/data/rules/asar-archives.yaml +1 -1
- package/data/rules/build-fidelity.yaml +782 -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/cli/bomAssembly.js +20 -1
- package/lib/cli/cliOptions.js +94 -7
- package/lib/cli/index.js +76 -48
- package/lib/cli/jsBom.js +32 -3
- package/lib/cli/jvmBom.js +1494 -1315
- package/lib/cli/managedBom.js +97 -28
- package/lib/cli/nativeBom.js +189 -10
- package/lib/core/buildLedger.js +799 -0
- package/lib/core/deferredExit.js +141 -0
- package/lib/core/env.js +69 -1
- 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/ecosystems/ecosystems.js +9 -0
- package/lib/ecosystems/gradleutils.js +355 -15
- package/lib/ecosystems/parsers-js.js +26 -0
- package/lib/ecosystems/parsers-jvm.js +9 -0
- package/lib/ecosystems/parsers-misc.js +16 -2
- package/lib/ecosystems/parsers-python.js +171 -35
- package/lib/ecosystems/parsers-rust.js +12 -2
- package/lib/ecosystems/pypiClassifiers.js +326 -0
- package/lib/ecosystems/pythonutils.js +49 -1
- package/lib/ecosystems/rubyutils.js +13 -0
- package/lib/evinser/evinser.js +30 -12
- package/lib/helpers/remote/dependency-track.js +81 -14
- package/lib/inventory/auditCategories.js +9 -0
- package/lib/inventory/depsUtils.js +72 -0
- package/lib/inventory/dosai.js +431 -22
- package/lib/inventory/envcontext.js +206 -18
- package/lib/inventory/fetchBatch.js +57 -0
- package/lib/inventory/jvmToolEnv.js +593 -0
- package/lib/inventory/osinfo.js +1 -0
- package/lib/inventory/toolRequirements.js +903 -0
- package/lib/managers/binary.js +24 -0
- package/lib/managers/docker.js +26 -5
- 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 +227 -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 +115 -2
- 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/validator/bomValidator.js +11 -2
- package/package.json +14 -14
- 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/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 +8 -0
- package/types/lib/cli/index.d.ts.map +1 -1
- package/types/lib/cli/jsBom.d.ts.map +1 -1
- package/types/lib/cli/jvmBom.d.ts.map +1 -1
- package/types/lib/cli/managedBom.d.ts.map +1 -1
- package/types/lib/cli/nativeBom.d.ts.map +1 -1
- package/types/lib/core/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 +22 -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/ecosystems/ecosystems.d.ts.map +1 -1
- package/types/lib/ecosystems/gradleutils.d.ts +33 -0
- package/types/lib/ecosystems/gradleutils.d.ts.map +1 -1
- package/types/lib/ecosystems/parsers-js.d.ts.map +1 -1
- package/types/lib/ecosystems/parsers-jvm.d.ts.map +1 -1
- package/types/lib/ecosystems/parsers-misc.d.ts.map +1 -1
- package/types/lib/ecosystems/parsers-python.d.ts.map +1 -1
- package/types/lib/ecosystems/parsers-rust.d.ts.map +1 -1
- package/types/lib/ecosystems/pypiClassifiers.d.ts +80 -0
- package/types/lib/ecosystems/pypiClassifiers.d.ts.map +1 -0
- package/types/lib/ecosystems/pythonutils.d.ts +20 -0
- package/types/lib/ecosystems/pythonutils.d.ts.map +1 -1
- package/types/lib/ecosystems/rubyutils.d.ts.map +1 -1
- package/types/lib/evinser/evinser.d.ts +5 -1
- package/types/lib/evinser/evinser.d.ts.map +1 -1
- 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/auditCategories.d.ts +8 -0
- package/types/lib/inventory/auditCategories.d.ts.map +1 -1
- package/types/lib/inventory/depsUtils.d.ts.map +1 -1
- package/types/lib/inventory/dosai.d.ts +20 -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/fetchBatch.d.ts +9 -0
- package/types/lib/inventory/fetchBatch.d.ts.map +1 -1
- package/types/lib/inventory/jvmToolEnv.d.ts +189 -0
- package/types/lib/inventory/jvmToolEnv.d.ts.map +1 -0
- package/types/lib/inventory/osinfo.d.ts.map +1 -1
- 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/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 +57 -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 +2 -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
|
@@ -95,6 +95,15 @@ export declare function prefetchJson(requests: Array<{
|
|
|
95
95
|
}>, options?: {
|
|
96
96
|
timeoutMs?: number;
|
|
97
97
|
}): Promise<Map<string, BatchEntry>>;
|
|
98
|
+
/**
|
|
99
|
+
* Record the run-level policy or connectivity condition carried by a caught
|
|
100
|
+
* fetch error, if it names one. Shared by the batch retry loop and by the
|
|
101
|
+
* serial enrichment paths that catch and swallow the same typed errors.
|
|
102
|
+
*
|
|
103
|
+
* @param {Error} err Error caught from a `cdxgenAgent` request.
|
|
104
|
+
* @returns {void}
|
|
105
|
+
*/
|
|
106
|
+
export declare function recordPolicyDegradationFromError(err: Error): void;
|
|
98
107
|
/**
|
|
99
108
|
* Read a prefetched response, or signal that the caller should fetch it itself.
|
|
100
109
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetchBatch.d.ts","sourceRoot":"","sources":["../../../lib/inventory/fetchBatch.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;
|
|
1
|
+
{"version":3,"file":"fetchBatch.d.ts","sourceRoot":"","sources":["../../../lib/inventory/fetchBatch.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AA8EH;;;GAGG;AACH,wBAAgB,cAAc,IAHjB,MAAM,GAAC,IAAI,CAKvB;AAED;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,IAFtB,OAAO,CASnB;AAED;;;GAGG;AACH,wBAAgB,2BAA2B,SAO1C;AAKE,YAAkB,UAAU,GAC5B;;;;IAAoB,EAAE,EAAX,OAAO,CAClB;;;;IAAe,IAAI,AAAnB,CACA,EADW,GAAC,CACZ;;;;IAAoB,MAAM,AAA1B,CACA,EADW,MAAM,CACjB;;;;;IAAqB,QAAQ,AAA7B,CAEF,EAFa,OAAO,CAEpB;CAAA,CAAA;AAoCD;;;;;;;;;;;;;;;GAeG;AACH,wBAAsB,YAAY,CAAC,QAAQ,EARhC,KAAK,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,YAAY,CAAC,EAAE,CAAC,MAAM,GAAC,MAAM,GAAC,QAAQ,CAAC,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAC,CAQnF,EAAE,OAAO,AANjD,CAEA,EADA;IAAyB,SAAS,AAAlC,CACA,EADQ,MAAM,CACd;CAIsD,GAJ5C,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC,CAgC5C;AA8UD;;;;;;;GAOG;AACH,wBAAgB,gCAAgC,CAAC,GAAG,EAHzC,KAGyC,GAFvC,IAAI,CAuBhB;AA4LD;;;;;;;;;;GAUG;AACH,wBAAgB,kBAAkB,CAAC,UAAU,EARlC,GAAG,CAAC,MAAM,EAAE,UAAU,CAQY,EAAE,GAAG,EAPvC,MAOuC,GANrC;IAAC,IAAI,EAAE,GAAC,CAAA;CAAC,GAAC,SAAS,CAoB/B;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,eAAe,IAFlB,OAAO,CAOnB"}
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
import { compareVersions, extractJavaMajor, isPrereleaseVersion } from "./toolRequirements.js";
|
|
2
|
+
/**
|
|
3
|
+
* The general-purpose version comparator, prerelease classifier, and JDK
|
|
4
|
+
* major extractor live in `toolRequirements.js` so every ecosystem shares one
|
|
5
|
+
* comparator; they are re-exported here under the names this module's
|
|
6
|
+
* consumers already use.
|
|
7
|
+
*/
|
|
8
|
+
export { compareVersions as compareSdkmanVersions, extractJavaMajor, isPrereleaseVersion, };
|
|
9
|
+
/**
|
|
10
|
+
* Anchored validator for sdkman version identifiers such as `3.9.9`,
|
|
11
|
+
* `4.0.0-rc-5`, `8.14`, or `21.0.7-tem`. Versions are interpolated into a
|
|
12
|
+
* shell command by the sdkman installer, so every identifier must be a single
|
|
13
|
+
* safe token: it must start with a digit and may only contain digits, ascii
|
|
14
|
+
* letters, dots, and hyphens.
|
|
15
|
+
*
|
|
16
|
+
* Every separator must be followed by at least one alphanumeric character, and
|
|
17
|
+
* a single repeated group covers both the dotted numeric part and the vendor
|
|
18
|
+
* or prerelease suffix. That leaves each character exactly one role, so the
|
|
19
|
+
* pattern matches in linear time on untrusted input.
|
|
20
|
+
*
|
|
21
|
+
* @param {string} version Candidate version identifier
|
|
22
|
+
* @returns {boolean} True when the identifier is safe to pass to sdkman
|
|
23
|
+
*/
|
|
24
|
+
export declare function isValidSdkmanVersion(version: string): boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Parse a versioned JVM build tool project type such as `maven3.9.9`,
|
|
27
|
+
* `mvn3.9.9`, `gradle8.14`, `sbt1.10`, or `scala3.6.4` into its sdkman
|
|
28
|
+
* candidate name and version token.
|
|
29
|
+
*
|
|
30
|
+
* The returned object distinguishes between a syntactically valid pin and a
|
|
31
|
+
* rejected one so callers can print a precise CLI error instead of silently
|
|
32
|
+
* ignoring the type.
|
|
33
|
+
*
|
|
34
|
+
* @param {string} projectType Project type argument from the CLI
|
|
35
|
+
* @returns {Object|undefined} `{ tool, version, valid }` when the type looks
|
|
36
|
+
* like a versioned JVM build tool, `undefined` otherwise. `valid` is false
|
|
37
|
+
* when the version token fails validation.
|
|
38
|
+
*/
|
|
39
|
+
export declare function parseJvmToolProjectType(projectType: string): Object | undefined;
|
|
40
|
+
/**
|
|
41
|
+
* Parse a `.sdkmanrc` environment file into the sdkman candidates it pins.
|
|
42
|
+
* Only the JVM-related candidates cdxgen knows how to provision are kept;
|
|
43
|
+
* unknown keys are ignored so newer sdkman files remain readable. Malformed
|
|
44
|
+
* lines are skipped instead of aborting the whole file.
|
|
45
|
+
*
|
|
46
|
+
* @param {string} filePath Project directory that may contain a `.sdkmanrc`
|
|
47
|
+
* @returns {Object|undefined} Map of candidate name to exact version
|
|
48
|
+
* identifier, or `undefined` when the file is missing or unreadable.
|
|
49
|
+
*/
|
|
50
|
+
export declare function parseSdkmanrc(filePath: string): Object | undefined;
|
|
51
|
+
/**
|
|
52
|
+
* Read the version pinned by a Gradle wrapper's `gradle-wrapper.properties`.
|
|
53
|
+
* The `distributionUrl` value may escape colons as `\:` per the Java
|
|
54
|
+
* properties format; the escapes are removed before parsing.
|
|
55
|
+
*
|
|
56
|
+
* @param {string} rootPath Directory holding the `gradle/wrapper` folder
|
|
57
|
+
* @returns {Object|undefined} `{ version, distributionUrl, distributionSha256Sum? }`
|
|
58
|
+
* or `undefined` when the wrapper is missing or unparsable.
|
|
59
|
+
*/
|
|
60
|
+
export declare function readGradleWrapperVersion(rootPath: string): Object | undefined;
|
|
61
|
+
/**
|
|
62
|
+
* Read the version pinned by a Maven wrapper's `maven-wrapper.properties`.
|
|
63
|
+
* Legacy wrappers (pre wrapper-distribution downloads) lack a
|
|
64
|
+
* `distributionUrl` and are treated as unpinned.
|
|
65
|
+
*
|
|
66
|
+
* @param {string} rootPath Directory holding the `.mvn/wrapper` folder
|
|
67
|
+
* @returns {Object|undefined} `{ version, distributionUrl }` or `undefined`
|
|
68
|
+
* when the wrapper is missing or unpinned.
|
|
69
|
+
*/
|
|
70
|
+
export declare function readMavenWrapperVersion(rootPath: string): Object | undefined;
|
|
71
|
+
/**
|
|
72
|
+
* Read the sbt version declared in `project/build.properties`. Kept here as a
|
|
73
|
+
* small properties-file read so environment preparation does not depend on
|
|
74
|
+
* higher layers.
|
|
75
|
+
*
|
|
76
|
+
* @param {string} projectPath SBT project directory
|
|
77
|
+
* @returns {string|undefined} Declared sbt version, when present and valid.
|
|
78
|
+
*/
|
|
79
|
+
export declare function readSbtBuildPropertiesVersion(projectPath: string): string | undefined;
|
|
80
|
+
/**
|
|
81
|
+
* Minimum JDK major version required to run each build tool, keyed by the
|
|
82
|
+
* tool's major version line. Versions absent from the table fall back to the
|
|
83
|
+
* tool's `default` entry.
|
|
84
|
+
*
|
|
85
|
+
* Sources: Maven release history (maven.apache.org/docs/history.html), the
|
|
86
|
+
* Gradle compatibility table (docs.gradle.org), and the sbt setup notes.
|
|
87
|
+
*
|
|
88
|
+
* @type {Object<string, Object<number, number>|number>}
|
|
89
|
+
*/
|
|
90
|
+
export declare const TOOL_JDK_REQUIREMENTS: Record<string, number | Record<number, number>>;
|
|
91
|
+
/**
|
|
92
|
+
* Minimum Gradle version that supports a given JDK major, for the
|
|
93
|
+
* combinations where running an older Gradle on a newer JDK is known to fail.
|
|
94
|
+
* Used to warn instead of guess-installing when the environment contradicts
|
|
95
|
+
* the project's Gradle pin.
|
|
96
|
+
*
|
|
97
|
+
* @type {Object<number, string>}
|
|
98
|
+
*/
|
|
99
|
+
export declare const GRADLE_JAVA_CAPS: Record<number, string>;
|
|
100
|
+
/** JDK major that satisfies every current build tool minimum. */
|
|
101
|
+
export declare const DEFAULT_JAVA_MAJOR = 21;
|
|
102
|
+
/**
|
|
103
|
+
* Look up the minimum JDK major required to run a tool version.
|
|
104
|
+
*
|
|
105
|
+
* @param {string} tool Tool name (maven, gradle, sbt, scala)
|
|
106
|
+
* @param {string} version Tool version identifier
|
|
107
|
+
* @returns {number|undefined} Minimum JDK major, when known.
|
|
108
|
+
*/
|
|
109
|
+
export declare function minimumJdkForToolVersion(tool: string, version: string): number | undefined;
|
|
110
|
+
/**
|
|
111
|
+
* Compute the highest JDK major required across a set of tool pins.
|
|
112
|
+
*
|
|
113
|
+
* @param {Array<{tool: string, version: string}>} toolPins Pinned tools
|
|
114
|
+
* @returns {number|undefined} Highest required JDK major, when any pin maps.
|
|
115
|
+
*/
|
|
116
|
+
export declare function determineRequiredJavaVersion(toolPins: Array<{
|
|
117
|
+
tool: string;
|
|
118
|
+
version: string;
|
|
119
|
+
}>): number | undefined;
|
|
120
|
+
/**
|
|
121
|
+
* Minimum Gradle version that can run on the given JDK major, when such a cap
|
|
122
|
+
* is known.
|
|
123
|
+
*
|
|
124
|
+
* @param {number} javaMajor JDK major version
|
|
125
|
+
* @returns {string|undefined} Minimum Gradle version, when capped.
|
|
126
|
+
*/
|
|
127
|
+
export declare function minimumGradleVersionForJava(javaMajor: number): string | undefined;
|
|
128
|
+
/**
|
|
129
|
+
* Collect the version tokens printed by `sdk list <candidate>`. The output is
|
|
130
|
+
* a fixed-width table whose cells may carry `+`, `*`, or `>` status markers;
|
|
131
|
+
* every token that passes the sdkman version validator is kept, which
|
|
132
|
+
* naturally drops banners, legends, and shell noise.
|
|
133
|
+
*
|
|
134
|
+
* @param {string} stdout Raw `sdk list` output
|
|
135
|
+
* @returns {string[]} Version identifiers found in the output.
|
|
136
|
+
*/
|
|
137
|
+
export declare function extractSdkListVersions(stdout: string): string[];
|
|
138
|
+
/**
|
|
139
|
+
* Resolve a partial version prefix such as `3.9` or `8.14` to the newest
|
|
140
|
+
* matching version in `sdk list` output. Stable versions are preferred unless
|
|
141
|
+
* the requested prefix itself is a prerelease.
|
|
142
|
+
*
|
|
143
|
+
* @param {string} stdout Raw `sdk list <candidate>` output
|
|
144
|
+
* @param {string} prefix Partial or exact version prefix; empty matches all
|
|
145
|
+
* @returns {string|undefined} Best matching version identifier.
|
|
146
|
+
*/
|
|
147
|
+
export declare function resolvePartialVersion(stdout: string, prefix: string): string | undefined;
|
|
148
|
+
/**
|
|
149
|
+
* Environment variable hints that carry a tool version, used by container
|
|
150
|
+
* images and CI setups to describe the preinstalled JVM toolchain.
|
|
151
|
+
*
|
|
152
|
+
* @type {Object<string, string>}
|
|
153
|
+
*/
|
|
154
|
+
export declare const JVM_TOOL_VERSION_ENV_HINTS: Record<string, string>;
|
|
155
|
+
/**
|
|
156
|
+
* Environment variable overrides that declare the sdkman version to use for
|
|
157
|
+
* a tool, mirroring the existing `JAVA<NN>_TOOL` pattern.
|
|
158
|
+
*
|
|
159
|
+
* @type {Object<string, string>}
|
|
160
|
+
*/
|
|
161
|
+
export declare const JVM_TOOL_VERSION_OVERRIDES: Record<string, string>;
|
|
162
|
+
/**
|
|
163
|
+
* Read the `MAVEN_TOOL`/`GRADLE_TOOL`/`SBT_TOOL`/`SCALA_TOOL` override for a
|
|
164
|
+
* tool, when set to a valid sdkman version identifier.
|
|
165
|
+
*
|
|
166
|
+
* @param {string} tool Tool name
|
|
167
|
+
* @returns {string|undefined} Overridden version identifier.
|
|
168
|
+
*/
|
|
169
|
+
export declare function readToolVersionOverride(tool: string): string | undefined;
|
|
170
|
+
/**
|
|
171
|
+
* Read the container/CI version hint (`MAVEN_VERSION` etc.) for a tool, when
|
|
172
|
+
* set to a valid sdkman version identifier.
|
|
173
|
+
*
|
|
174
|
+
* @param {string} tool Tool name
|
|
175
|
+
* @returns {string|undefined} Hinted version identifier.
|
|
176
|
+
*/
|
|
177
|
+
export declare function readToolVersionEnvHint(tool: string): string | undefined;
|
|
178
|
+
/**
|
|
179
|
+
* Detect the JDK major a project asks for from its build files: Gradle
|
|
180
|
+
* toolchain declarations (`JavaLanguageVersion.of(N)`) and Maven compiler or
|
|
181
|
+
* enforcer properties (`maven.compiler.release`, `maven.compiler.source`,
|
|
182
|
+
* `requireJavaVersion`). The scan is intentionally line-based and
|
|
183
|
+
* conservative: it only recognises whole-number values.
|
|
184
|
+
*
|
|
185
|
+
* @param {string} projectPath Project directory
|
|
186
|
+
* @returns {number|undefined} JDK major requested by the project.
|
|
187
|
+
*/
|
|
188
|
+
export declare function detectProjectJavaMajor(projectPath: string): number | undefined;
|
|
189
|
+
//# sourceMappingURL=jvmToolEnv.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jvmToolEnv.d.ts","sourceRoot":"","sources":["../../../lib/inventory/jvmToolEnv.js"],"names":[],"mappings":"AAMA,OAAO,EAC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Ac5B;AAED;;;;;;GAMG;AACH,wBAAgB,2BAA2B,CAAC,SAAS,EAH1C,MAG0C,GAFxC,MAAM,GAAC,SAAS,CAI5B;AAED;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAHlC,MAGkC,GAFhC,MAAM,EAAE,CAgBpB;AAED;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAJjC,MAIiC,EAAE,MAAM,EAHzC,MAGyC,GAFvC,MAAM,GAAC,SAAS,CAwB5B;AAED;;;;;GAKG;AACH,eAAO,MAAM,0BAA0B,wBAKtC,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,0BAA0B,wBAKtC,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAHjC,MAGiC,GAF/B,MAAM,GAAC,SAAS,CAS5B;AAED;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,EAHhC,MAGgC,GAF9B,MAAM,GAAC,SAAS,CAS5B;AASD;;;;;;;;;GASG;AACH,wBAAgB,sBAAsB,CAAC,WAAW,EAHvC,MAGuC,GAFrC,MAAM,GAAC,SAAS,CAuB5B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"osinfo.d.ts","sourceRoot":"","sources":["../../../lib/inventory/osinfo.js"],"names":[],"mappings":"AAGA;;;GAGG;AACH,eAAO,MAAM,eAAe;IAC1B,aAAa;IACb,aAAa;IACb,aAAa;IACb,aAAa;IACb,aAAa;IACb,aAAa;IACb,aAAa;IACb,aAAa;IACb,aAAa;IACb,aAAa;IACb,aAAa;IACb,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;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C;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,aAAa,CAAC,IAAI,AAH/B,CACA,EADQ,MAG6B,GAF3B;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,
|
|
1
|
+
{"version":3,"file":"osinfo.d.ts","sourceRoot":"","sources":["../../../lib/inventory/osinfo.js"],"names":[],"mappings":"AAGA;;;GAGG;AACH,eAAO,MAAM,eAAe;IAC1B,aAAa;IACb,aAAa;IACb,aAAa;IACb,aAAa;IACb,aAAa;IACb,aAAa;IACb,aAAa;IACb,aAAa;IACb,aAAa;IACb,aAAa;IACb,aAAa;IACb,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,WAAW;IACX,WAAW;IACX,aAAa;IACb,WAAW;IACX,aAAa;IACb,WAAW;IACX,aAAa;IACb,aAAa;IACb,WAAW;IACX,aAAa;IACb,WAAW;IACX,aAAa;IACb,UAAU;IACV,YAAY;IACZ,UAAU;IACV,YAAY;IACZ,UAAU;IACV,YAAY;IACZ,UAAU;IACV,UAAU;IACV,UAAU;IACV,YAAY;IACZ,UAAU;IACV,YAAY;IACZ,YAAY;IACZ,UAAU;IACV,YAAY;IACZ,YAAY;IACZ,YAAY;IACZ,0BAA0B;IAC1B,4BAA4B;IAC5B,4BAA4B;IAC5B,4BAA4B;IAC5B,4BAA4B;IAC5B,6BAA6B;CAC9B,CAAC;AAEF;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,kBAAkB;IAC7B,IAAI;IACJ,WAAW;IACX,IAAI;IACJ,UAAU;IACV,aAAa;IACb,OAAO;IACP,EAAE;IACF,eAAe;IACf,qBAAqB;IACrB,IAAI;IACJ,aAAa;CACd,CAAC;AAEF;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,yBAAyB;IACpC,IAAI;IACJ,WAAW;IACX,IAAI;IACJ,UAAU;IACV,aAAa;IACb,OAAO;IACP,EAAE;IACF,IAAI;IACJ,aAAa;CACd,CAAC;AASF;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,SAAS,EAHrC,MAGqC,GAFnC,OAAO,CAInB;AAMD;;;;;;;;GAQG;AACH,wBAAgB,wBAAwB,CAAC,SAAS,EAHvC,MAGuC,GAFrC,MAAM,CAYlB;AAQD;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAAC,IAAI,AAJ/B,CAEA,EAFQ,MAI6B,GAF3B,MAAM,CAqClB;AAGD;;GAEG;AACH,wBAAgB,oBAAoB,SAEnC;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,aAAa,CAAC,IAAI,AAH/B,CACA,EADQ,MAG6B,GAF3B;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,CAkHzF"}
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resolve the ecosystem a declared tool belongs to.
|
|
3
|
+
*
|
|
4
|
+
* @param {string} tool Declared tool name
|
|
5
|
+
* @returns {string} cdxgen ecosystem name, or "generic" for unknown tools.
|
|
6
|
+
*/
|
|
7
|
+
export declare function ecosystemForTool(tool: string): string;
|
|
8
|
+
/**
|
|
9
|
+
* Check whether a version identifier carries a prerelease suffix such as
|
|
10
|
+
* `-rc-3`, `-M2`, or `-milestone-1`. The marker list is exact so that vendor
|
|
11
|
+
* suffixes that merely begin with the same letters, such as the `-crac` java
|
|
12
|
+
* distributions, stay classified as stable.
|
|
13
|
+
*
|
|
14
|
+
* @param {string} version Version identifier
|
|
15
|
+
* @returns {boolean} True for prerelease versions.
|
|
16
|
+
*/
|
|
17
|
+
export declare function isPrereleaseVersion(version: string): boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Compare two dotted version identifiers. Numeric components are compared
|
|
20
|
+
* numerically, stable releases rank above prereleases, and prerelease
|
|
21
|
+
* suffixes are compared token-wise so `rc-9` beats `rc-10` only when
|
|
22
|
+
* numerically larger. Missing components count as zero, so `21` equals
|
|
23
|
+
* `21.0.0`.
|
|
24
|
+
*
|
|
25
|
+
* @param {string} a First version
|
|
26
|
+
* @param {string} b Second version
|
|
27
|
+
* @returns {number} Negative when a < b, positive when a > b, zero on equality.
|
|
28
|
+
*/
|
|
29
|
+
export declare function compareVersions(a: string, b: string): number;
|
|
30
|
+
/**
|
|
31
|
+
* Extract the JDK major from a `java --version` style description such as
|
|
32
|
+
* `openjdk 21.0.11 2025-04-15` or a bare sdkman java identifier such as
|
|
33
|
+
* `25-tem`. General availability releases print an undotted major
|
|
34
|
+
* (`openjdk 25 2025-09-16`), so the first token starting with a digit is
|
|
35
|
+
* used rather than requiring a dotted version.
|
|
36
|
+
*
|
|
37
|
+
* @param {string} versionDesc Version description string
|
|
38
|
+
* @returns {number|undefined} JDK major version.
|
|
39
|
+
*/
|
|
40
|
+
export declare function extractJavaMajor(versionDesc: string): number | undefined;
|
|
41
|
+
/**
|
|
42
|
+
* Extract the first version-looking token from a tool version description,
|
|
43
|
+
* such as `go version go1.23.1 darwin/arm64` or `rustc 1.82.0 (f6e511eec
|
|
44
|
+
* 2024-10-08)`. Leading letters (`v20.11.1`, `go1.23.1`) and quoting are
|
|
45
|
+
* stripped before validation.
|
|
46
|
+
*
|
|
47
|
+
* @param {string} versionDesc Raw version description
|
|
48
|
+
* @returns {string|undefined} The version token, when one is found.
|
|
49
|
+
*/
|
|
50
|
+
export declare function extractVersionToken(versionDesc: string): string | undefined;
|
|
51
|
+
export type RequirementVerdict = "satisfied" | "violated" | "unparseable";
|
|
52
|
+
/**
|
|
53
|
+
* Verdict of a declared-requirement check. `unparseable` means the wanted or
|
|
54
|
+
* found value carries no comparable version, which is never evidence of a
|
|
55
|
+
* defect: an unparseable requirement must not produce a mismatch.
|
|
56
|
+
*
|
|
57
|
+
* @typedef {"satisfied"|"violated"|"unparseable"} RequirementVerdict
|
|
58
|
+
*/
|
|
59
|
+
/**
|
|
60
|
+
* Check whether a found version satisfies a declared requirement. Wanted
|
|
61
|
+
* forms handled: exact versions (`3.9.9`), major-only and partial pins
|
|
62
|
+
* (`21`, `20.11`), `.x` ranges (`20.x`), caret and tilde ranges (`^20.11`,
|
|
63
|
+
* `~4.9`), comparison ranges (`>=18`, `<21`), hyphen ranges (`1.9 - 2.3`),
|
|
64
|
+
* whitespace-conjoined ranges (`>=18 <=20`), `||` alternatives, and the
|
|
65
|
+
* unconstrained `*`/`latest`. Anything else is unparseable and never
|
|
66
|
+
* violates.
|
|
67
|
+
*
|
|
68
|
+
* @param {string} found Version actually present, possibly embedded in a
|
|
69
|
+
* longer description such as `go version go1.23.1 darwin/arm64`.
|
|
70
|
+
* @param {string} wanted Declared requirement.
|
|
71
|
+
* @returns {RequirementVerdict} Verdict of the check.
|
|
72
|
+
*/
|
|
73
|
+
export declare function checkVersionRequirement(found: string, wanted: string): RequirementVerdict;
|
|
74
|
+
/**
|
|
75
|
+
* Classify the result of a failed tool probe. A probe that was denied the
|
|
76
|
+
* right to run must be reported as `denied` — the tool may well be present —
|
|
77
|
+
* while only evidence that the command does not exist counts as `missing`.
|
|
78
|
+
*
|
|
79
|
+
* @param {Object|string|undefined} result Result object from spawnSync, or
|
|
80
|
+
* undefined when no result shape is known.
|
|
81
|
+
* @returns {"found"|"denied"|"missing"} Classification of the probe result.
|
|
82
|
+
*/
|
|
83
|
+
export declare function classifyProbeResult(result: Object | string | undefined): "found" | "denied" | "missing";
|
|
84
|
+
/**
|
|
85
|
+
* Classify the active environment restriction that would stop a command from
|
|
86
|
+
* running, without the human-readable wording. `describeSpawnRestriction`
|
|
87
|
+
* derives its message from this classifier, and consumers that need to act on
|
|
88
|
+
* the cause rather than the prose use it directly.
|
|
89
|
+
*
|
|
90
|
+
* @param {string} command Command that would run
|
|
91
|
+
* @returns {"dry-run"|"secure-mode"|"allowlist"|"deno"|undefined} Restriction cause, or undefined when nothing restricts the command.
|
|
92
|
+
*/
|
|
93
|
+
export declare function classifySpawnRestriction(command: string): "dry-run" | "secure-mode" | "allowlist" | "deno" | undefined;
|
|
94
|
+
/**
|
|
95
|
+
* Explain why a command probe may not run in the current environment, so a
|
|
96
|
+
* failed probe can be reported as degraded evidence rather than a missing
|
|
97
|
+
* tool.
|
|
98
|
+
*
|
|
99
|
+
* @param {string} command Command that was probed
|
|
100
|
+
* @returns {string|undefined} Human-readable restriction, or undefined when
|
|
101
|
+
* the environment does not restrict the command.
|
|
102
|
+
*/
|
|
103
|
+
export declare function describeSpawnRestriction(command: string): string | undefined;
|
|
104
|
+
/**
|
|
105
|
+
* Parse the content of an asdf/mise `.tool-versions` file into the first
|
|
106
|
+
* version each tool declares. Comment lines and inline comments are ignored;
|
|
107
|
+
* a tool line listing several versions keeps the first.
|
|
108
|
+
*
|
|
109
|
+
* @param {string} content `.tool-versions` file content
|
|
110
|
+
* @returns {Object|undefined} Map of tool name to declared version.
|
|
111
|
+
*/
|
|
112
|
+
export declare function parseToolVersionsFile(content: string): Object | undefined;
|
|
113
|
+
/**
|
|
114
|
+
* Parse the `go` and `toolchain` directives of a `go.mod` file. The
|
|
115
|
+
* `toolchain` directive wins when both are present because it names the
|
|
116
|
+
* exact toolchain the module asks for.
|
|
117
|
+
*
|
|
118
|
+
* @param {string} content `go.mod` file content
|
|
119
|
+
* @returns {Object|undefined} `{ tool, version, directive }` with
|
|
120
|
+
* `directive` naming the line the version came from.
|
|
121
|
+
*/
|
|
122
|
+
export declare function parseGoModFile(content: string): Object | undefined;
|
|
123
|
+
/**
|
|
124
|
+
* Parse a `rust-toolchain.toml` or plain `rust-toolchain` file into its
|
|
125
|
+
* channel. Target-specific subsections are ignored, so only the `[toolchain]`
|
|
126
|
+
* section's `channel` key is read.
|
|
127
|
+
*
|
|
128
|
+
* @param {string} content Toolchain file content
|
|
129
|
+
* @returns {Object|undefined} `{ channel }` when a channel is declared.
|
|
130
|
+
*/
|
|
131
|
+
export declare function parseRustToolchainFile(content: string): Object | undefined;
|
|
132
|
+
/**
|
|
133
|
+
* Parse a `package.json` content into the tool requirements it declares
|
|
134
|
+
* through `engines` and `packageManager`. The `packageManager` pin's
|
|
135
|
+
* integrity-hash suffix (`pnpm@9.1.0+sha512.…`) is stripped to the bare
|
|
136
|
+
* version.
|
|
137
|
+
*
|
|
138
|
+
* @param {string} content `package.json` content
|
|
139
|
+
* @returns {Object|undefined} Map of tool name to declared version.
|
|
140
|
+
*/
|
|
141
|
+
export declare function parsePackageJsonToolRequirements(content: string): Object | undefined;
|
|
142
|
+
/**
|
|
143
|
+
* Parse a `global.json` file into the .NET SDK version it pins.
|
|
144
|
+
*
|
|
145
|
+
* @param {string} content `global.json` content
|
|
146
|
+
* @returns {Object|undefined} Map with the `dotnet` requirement.
|
|
147
|
+
*/
|
|
148
|
+
export declare function parseGlobalJsonToolRequirements(content: string): Object | undefined;
|
|
149
|
+
/**
|
|
150
|
+
* Parse the `requires-python` declaration of a `pyproject.toml` file.
|
|
151
|
+
*
|
|
152
|
+
* @param {string} content `pyproject.toml` content
|
|
153
|
+
* @returns {Object|undefined} Map with the `python` requirement.
|
|
154
|
+
*/
|
|
155
|
+
export declare function parsePyprojectRequiresPython(content: string): Object | undefined;
|
|
156
|
+
/**
|
|
157
|
+
* Parse an `.nvmrc` file into the Node.js version it requests.
|
|
158
|
+
*
|
|
159
|
+
* @param {string} content `.nvmrc` content
|
|
160
|
+
* @returns {Object|undefined} Map with the `node` requirement.
|
|
161
|
+
*/
|
|
162
|
+
export declare function parseNvmrc(content: string): Object | undefined;
|
|
163
|
+
/**
|
|
164
|
+
* Parse a `.python-version` file into the interpreter version it requests.
|
|
165
|
+
*
|
|
166
|
+
* @param {string} content `.python-version` content
|
|
167
|
+
* @returns {Object|undefined} Map with the `python` requirement.
|
|
168
|
+
*/
|
|
169
|
+
export declare function parsePythonVersionFile(content: string): Object | undefined;
|
|
170
|
+
/**
|
|
171
|
+
* Parse a `.java-version` file into the JDK version it pins. Both the bare
|
|
172
|
+
* major (`21`) and a full version (`21.0.5`) occur in the wild, and both are
|
|
173
|
+
* passed through verbatim — an install command needs the exact declaration.
|
|
174
|
+
*
|
|
175
|
+
* The legacy `1.N` spelling of a pre-9 release (`1.8`, `1.8.0_302`) is
|
|
176
|
+
* normalised to its modern major (`8`), because it is the major line that
|
|
177
|
+
* names a package: the literal declaration yields `Temurin.1.JDK`, which no
|
|
178
|
+
* provisioner offers.
|
|
179
|
+
*
|
|
180
|
+
* Distribution-prefixed values written by version managers (`temurin-21`,
|
|
181
|
+
* `openjdk64-17.0.1`) name a vendor build rather than a release, so they are
|
|
182
|
+
* left unparsed rather than turned into an install argument no provisioner
|
|
183
|
+
* accepts; the run then reports the version as unresolved and the agent asks.
|
|
184
|
+
*
|
|
185
|
+
* @param {string} content `.java-version` content
|
|
186
|
+
* @returns {Object|undefined} Map with the `java` requirement.
|
|
187
|
+
*/
|
|
188
|
+
export declare function parseJavaVersionFile(content: string): Object | undefined;
|
|
189
|
+
/**
|
|
190
|
+
* Parse the `BUNDLED WITH` section of a `Gemfile.lock` into the bundler
|
|
191
|
+
* version the lockfile was written with.
|
|
192
|
+
*
|
|
193
|
+
* @param {string} content `Gemfile.lock` content
|
|
194
|
+
* @returns {string|undefined} Bundler version, when declared.
|
|
195
|
+
*/
|
|
196
|
+
export declare function parseGemfileLockBundlerVersion(content: string): string | undefined;
|
|
197
|
+
/**
|
|
198
|
+
* Read every declared tool requirement a project directory declares through
|
|
199
|
+
* its well-known tool pin files: `.tool-versions`, `.nvmrc`, `.java-version`,
|
|
200
|
+
* `.python-version`, `pyproject.toml`, `go.mod`, `rust-toolchain.toml`,
|
|
201
|
+
* `rust-toolchain`, `package.json`, and `global.json`. Missing files are
|
|
202
|
+
* skipped; each entry names the file that declared it so the report can
|
|
203
|
+
* trace every expectation back to its source.
|
|
204
|
+
*
|
|
205
|
+
* @param {string} projectPath Project directory to inspect
|
|
206
|
+
* @returns {Array<{tool: string, wanted: string, source: string, ecosystem: string, path: string}>}
|
|
207
|
+
* Declared requirements, empty when the directory declares none.
|
|
208
|
+
*/
|
|
209
|
+
export declare function readDeclaredToolRequirements(projectPath: string): Array<{
|
|
210
|
+
tool: string;
|
|
211
|
+
wanted: string;
|
|
212
|
+
source: string;
|
|
213
|
+
ecosystem: string;
|
|
214
|
+
path: string;
|
|
215
|
+
}>;
|
|
216
|
+
//# sourceMappingURL=toolRequirements.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toolRequirements.d.ts","sourceRoot":"","sources":["../../../lib/inventory/toolRequirements.js"],"names":[],"mappings":"AAqEA;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAH1B,MAG0B,GAFxB,MAAM,CAIlB;AAED;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAHhC,MAGgC,GAF9B,OAAO,CAanB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAJtB,MAIsB,EAAE,CAAC,EAHzB,MAGyB,GAFvB,MAAM,CA0ClB;AAED;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAAC,WAAW,EAHjC,MAGiC,GAF/B,MAAM,GAAC,SAAS,CAyB5B;AAED;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CAAC,WAAW,EAHpC,MAGoC,GAFlC,MAAM,GAAC,SAAS,CAgB5B;AAOE,YAAgD,kBAAkB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M,GAAC,SAAS,CAY5B;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAHnC,MAGmC,GAFjC,MAAM,GAAC,SAAS,CAQ5B;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAHjC,MAGiC,GAF/B,MAAM,GAAC,SAAS,CAY5B;AAED;;;;;;GAMG;AACH,wBAAgB,8BAA8B,CAAC,OAAO,EAH3C,MAG2C,GAFzC,MAAM,GAAC,SAAS,CAwB5B;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,4BAA4B,CAAC,WAAW,EAJ7C,MAI6C,GAH3C,KAAK,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAC,CAAC,CAwFlG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"binary.d.ts","sourceRoot":"","sources":["../../../lib/managers/binary.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"binary.d.ts","sourceRoot":"","sources":["../../../lib/managers/binary.js"],"names":[],"mappings":"AA0YA;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CAAC,SAAS,AAH9C,CACA,EADQ,MAAM,EAGqC,GAFzC,MAAM,EAAE,CAgBpB;AA4FD;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,EAJ9B,MAI8B,GAH5B,MAAM,GAAC,SAAS,CAmB5B;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,OAAA,GAF3B,SAAS,GAAC,MAAM,CAkB5B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,8BAA8B,CAC5C,IAAI,EARK,MAQL,EACJ,OAAO,EARE,MAQF,EACP,IAAI,EARK,MAQL,EACJ,KAAK,EARI,MAQJ,EACL,QAAQ,AARP,CACA,EADQ,MAQD,GAPG,MAAM,CAgDlB;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAJ/B,MAI+B,EAAE,QAAQ,AAHjD,CACA,EADQ,MAGyC,GAFvC,MAAM,CA6BlB;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,6BAA6B,CAAC,OAAO,OAAA,SAoBpD;AAED;;;;;;;;GAQG;AACH,wBAAsB,aAAa,CAAC,GAAG,QAAA,EAAE,WAAW,EAL7B,MAK6B,EAAE,OAAO,KAAK,GAFrD,MAAM,CA4mBlB;AAkwDD;;;;;;;;GAQG;AACH,wBAAgB,+BAA+B,CAAC,UAAU,AALvD,CACA,EADQ,MAAM,EAK8C,GAJlD;IAAC,UAAU,EAAE,MAAM,EAAE,CAAC;IAAC,KAAK,EAAE,MAAM,EAAE,CAAA;CAAC,CAmEnD;AAED;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,KAAK,EALzB,MAKyB,GAJvB,MAAM,GAAC,SAAS,CA8D5B;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAJxB,MAIwB,EAAE,UAAU,EAHpC,MAGoC,WA6C9C;AAED;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAAC,GAAG,EANrB,MAMqB,EAAE,aAAa,EALpC,MAKoC,EAAE,QAAQ,EAJ9C,OAI8C,GAF7C,OAAO,CAiClB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"docker.d.ts","sourceRoot":"","sources":["../../../lib/managers/docker.js"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"docker.d.ts","sourceRoot":"","sources":["../../../lib/managers/docker.js"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAwCrC,yDAAyD;AACzD,e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MAAM,GAAC,SAAS,CAKpC,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,kBAAkB,cALpB,MAAM,iBACN,MAAM,KACJ,MAAM,GAAC,SA2CnB,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,kBAAkB,qBAHpB,KAAK,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAC,CAAC,cACnC,KAAK,CAAC,MAAM,CAAC,SA4BvB,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared assembly of CycloneDX document-level annotations.
|
|
3
|
+
*
|
|
4
|
+
* Two postgen features attach findings to the BOM document as annotations
|
|
5
|
+
* whose `subjects` is the BOM serial number: the BOM audit's rule findings and
|
|
6
|
+
* the build introspection's remediations. Both describe the document rather
|
|
7
|
+
* than a component, both are annotated by the cdxgen tool component from
|
|
8
|
+
* metadata, and both carry the document's own timestamp because an annotation
|
|
9
|
+
* describes the document it is attached to. The structured facts travel as
|
|
10
|
+
* `name`/`value` pairs rendered into the annotation text, one `:evidence:<key>`
|
|
11
|
+
* entry per evidence item.
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* Flatten an evidence object into `:evidence:<key>` property entries. Nested
|
|
15
|
+
* values are serialized as JSON so every property value stays a string.
|
|
16
|
+
*
|
|
17
|
+
* @param {string} propertyNamePrefix Property namespace, e.g. "cdx:audit".
|
|
18
|
+
* @param {Object} evidence Arbitrary key/value evidence facts.
|
|
19
|
+
* @returns {{name: string, value: string}[]} Property entries.
|
|
20
|
+
*/
|
|
21
|
+
export declare function evidenceProperties(propertyNamePrefix: string, evidence: Object): {
|
|
22
|
+
name: string;
|
|
23
|
+
value: string;
|
|
24
|
+
}[];
|
|
25
|
+
/**
|
|
26
|
+
* Build one document-level annotation. Returns undefined when the BOM carries
|
|
27
|
+
* no cdxgen tool component to annotate with; the caller decides whether that
|
|
28
|
+
* is worth a warning.
|
|
29
|
+
*
|
|
30
|
+
* @param {Object} params Annotation inputs.
|
|
31
|
+
* @param {Object} params.bomJson CycloneDX BOM the annotation describes.
|
|
32
|
+
* @param {string} params.message Leading annotation sentence.
|
|
33
|
+
* @param {{name: string, value: string}[]} params.properties Structured facts rendered into the annotation text.
|
|
34
|
+
* @returns {Object|undefined} CycloneDX annotation, or undefined without an annotator.
|
|
35
|
+
*/
|
|
36
|
+
export declare function buildDocumentAnnotation({ bomJson, message, properties }: {
|
|
37
|
+
bomJson: Object;
|
|
38
|
+
message: string;
|
|
39
|
+
properties: {
|
|
40
|
+
name: string;
|
|
41
|
+
value: string;
|
|
42
|
+
}[];
|
|
43
|
+
}): Object | undefined;
|
|
44
|
+
/**
|
|
45
|
+
* Warn that a document could not be annotated because it carries no cdxgen
|
|
46
|
+
* tool component. Suppressed outside debug mode, where the missing annotator
|
|
47
|
+
* is an expected shape for foreign BOMs.
|
|
48
|
+
*
|
|
49
|
+
* @param {string} feature Feature that wanted to annotate.
|
|
50
|
+
* @returns {void}
|
|
51
|
+
*/
|
|
52
|
+
export declare function warnMissingAnnotator(feature: string): void;
|
|
53
|
+
//# sourceMappingURL=annotationBuilder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"annotationBuilder.d.ts","sourceRoot":"","sources":["../../../../lib/stages/postgen/annotationBuilder.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAmBH;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,kBAAkB,EAJ1C,MAI0C,EAAE,QAAQ,EAHpD,MAGoD,GAFlD;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAC,EAAE,CAe3C;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,uBAAuB,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,EALrE;IAAuB,OAAO,EAAtB,MAAM,CACd;IAAuB,OAAO,EAAtB,MAAM,CACd;IAAgD,UAAU,EAAlD;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAC,EAAE,CACvC;CAEqE,GAF3D,MAAM,GAAC,SAAS,CAkB5B;AAED;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAHjC,MAGiC,GAF/B,IAAI,CAQhB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auditBom.d.ts","sourceRoot":"","sources":["../../../../lib/stages/postgen/auditBom.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"auditBom.d.ts","sourceRoot":"","sources":["../../../../lib/stages/postgen/auditBom.js"],"names":[],"mappings":"AAyEA;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAH1B,MAG0B,GAFxB,OAAO,CAInB;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAH1B,MAG0B,GAFxB,OAAO,CA4BnB;AAuBD;;;;;GAKG;AACH,wBAAsB,+BAA+B,CAAC,OAAO,AAH1D,CACA,EADQ,MAGuD,GAFrD,OAAO,CAAC;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,CAAC,CAKrG;AAED;;;;;GAKG;AACH,wBAAgB,0BAA0B,CAAC,OAAO,EAHvC;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAGvC,GAFrC,MAAM,CAOlB;AA+BD;;;;;;;;;GASG;AACH,wBAAgB,4BAA4B,CAAC,OAAO,EAHzC,MAGyC,EAAE,OAAO,GAFlD,MAEuD,QAuBjE;AAED;;;;;;;GAOG;AACH,wBAAsB,2BAA2B,CAAC,OAAO,EAH9C,MAG8C,EAAE,OAAO,GAFvD,MAE4D,iBAkCtE;AAED;;;;;GAKG;AACH,wBAAsB,QAAQ,CAAC,OAAO,EAJ3B,MAI2B,EAAE,OAAO,EAHpC,MAGoC,GAFlC,OAAO,OAAO,CAwC1B;AAED;;;;;GAKG;AACH,wBAAgB,2BAA2B,CAAC,QAAQ,OAAA,GAFvC,MAAM,CAmClB;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,OAAA,GAF/B,MAAM,CAQlB;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,OAAA,EAAE,OAAO,EAHxC,MAGwC,SAyElD;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,KAAA,EAAE,OAAO,KAAA,OAQpD"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* BOM mutations that carry the introspection verdict inside the document:
|
|
3
|
+
* eight metadata properties and a block of document-level annotations.
|
|
4
|
+
*
|
|
5
|
+
* Sidecar report files get lost; the BOM travels. A consumer who receives
|
|
6
|
+
* only the BOM still learns how much to trust it from the metadata properties,
|
|
7
|
+
* and the annotations carry one entry per remediation the loop should act on.
|
|
8
|
+
* No component or dependency is touched.
|
|
9
|
+
*
|
|
10
|
+
* Both mutations are replace-by-name: a document that was already introspected
|
|
11
|
+
* (a BOM enriched again after an evidence pass) loses its previous
|
|
12
|
+
* introspection state and gains a fresh one, so the verdict always describes
|
|
13
|
+
* the final document.
|
|
14
|
+
*/
|
|
15
|
+
/**
|
|
16
|
+
* Version of the introspection BOM surface. Matches the JSON report's
|
|
17
|
+
* schemaVersion so the two stay comparable.
|
|
18
|
+
*
|
|
19
|
+
* @type {string}
|
|
20
|
+
*/
|
|
21
|
+
export declare const INTROSPECTION_SCHEMA_VERSION: string;
|
|
22
|
+
/**
|
|
23
|
+
* Namespace of every property and annotation entry this module emits.
|
|
24
|
+
*
|
|
25
|
+
* @type {string}
|
|
26
|
+
*/
|
|
27
|
+
export declare const INTROSPECTION_PROPERTY_PREFIX: string;
|
|
28
|
+
/**
|
|
29
|
+
* The metadata properties that summarize the verdict, in emission order. The
|
|
30
|
+
* overall tier and confidence are omitted when the run produced no scored row
|
|
31
|
+
* (nothing was graded, so no verdict is claimed); per-ecosystem rows cover the
|
|
32
|
+
* scored ecosystems only, since unsupported ones have neither a tier nor a
|
|
33
|
+
* score.
|
|
34
|
+
*
|
|
35
|
+
* @param {Object} reflection Reflection document from reflectOnRun.
|
|
36
|
+
* @param {Object} scored Scoring document from scoreReflection.
|
|
37
|
+
* @returns {{name: string, value: string}[]} Metadata property entries.
|
|
38
|
+
*/
|
|
39
|
+
export declare function introspectionMetadataProperties(reflection: Object, scored: Object): {
|
|
40
|
+
name: string;
|
|
41
|
+
value: string;
|
|
42
|
+
}[];
|
|
43
|
+
/**
|
|
44
|
+
* Attach the introspection verdict to the document: metadata properties plus
|
|
45
|
+
* the summary and remediation annotations. Any introspection state left on the
|
|
46
|
+
* document by a previous pass is removed first, so enrichment flows that run
|
|
47
|
+
* post-processing twice leave exactly one verdict.
|
|
48
|
+
*
|
|
49
|
+
* @param {Object} bomJson CycloneDX BOM, mutated in place.
|
|
50
|
+
* @param {Object} reflection Reflection document from reflectOnRun.
|
|
51
|
+
* @param {Object} scored Scoring document from scoreReflection.
|
|
52
|
+
* @param {Object} [guards] Emission guards.
|
|
53
|
+
* @param {boolean} [guards.annotations] False skips the annotations, for documents at a spec version that predates them.
|
|
54
|
+
* @returns {Object} The mutated BOM.
|
|
55
|
+
*/
|
|
56
|
+
export declare function applyIntrospectionToBom(bomJson: Object, reflection: Object, scored: Object, guards?: {
|
|
57
|
+
annotations?: boolean;
|
|
58
|
+
}): Object;
|
|
59
|
+
/**
|
|
60
|
+
* Stamp every formulation workflow with the id of the run that reflected over
|
|
61
|
+
* the document, so a later consumer of the BOM can tell a formulation record
|
|
62
|
+
* this run generated from one that arrived with a foreign BOM. The stamp is
|
|
63
|
+
* replace-by-name, matching how the rest of the verdict mutates the
|
|
64
|
+
* document: a BOM enriched twice keeps only the latest run's id.
|
|
65
|
+
*
|
|
66
|
+
* @param {Object} bomJson CycloneDX BOM, mutated in place.
|
|
67
|
+
* @param {string} runId Run id of the introspection pass.
|
|
68
|
+
* @returns {Object} The mutated BOM.
|
|
69
|
+
*/
|
|
70
|
+
export declare function applyFormulationRunIdMarker(bomJson: Object, runId: string): Object;
|
|
71
|
+
/**
|
|
72
|
+
* Whether a BOM already carries an introspection verdict.
|
|
73
|
+
*
|
|
74
|
+
* Evidence collection re-processes a finished BOM through a fresh wrapper, so
|
|
75
|
+
* the document itself is the only marker that survives between passes.
|
|
76
|
+
*
|
|
77
|
+
* @param {Object} bomJson CycloneDX BOM.
|
|
78
|
+
* @returns {boolean} True when the BOM was already introspected.
|
|
79
|
+
*/
|
|
80
|
+
export declare function hasIntrospectionVerdict(bomJson: Object): boolean;
|
|
81
|
+
//# sourceMappingURL=annotate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"annotate.d.ts","sourceRoot":"","sources":["../../../../../lib/stages/postgen/introspection/annotate.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AASH;;;;;GAKG;AACH,eAAO,MAAM,4BAA4B,EAF/B,MAEuC,CAAC;AAElD;;;;GAIG;AACH,eAAO,MAAM,6BAA6B,EAFhC,MAEsD,CAAC;AAEjE;;;;;;;;;;GAUG;AACH,wBAAgB,+BAA+B,CAAC,UAAU,EAJ/C,MAI+C,EAAE,MAAM,EAHvD,MAGuD,GAFrD;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAC,EAAE,CA6C3C;AAoHD;;;;;;;;;;;;GAYG;AACH,wBAAgB,uBAAuB,CACrC,OAAO,EARE,MAQF,EACP,UAAU,EARD,MAQC,EACV,MAAM,EARG,MAQH,EACN,MAAM,AARL,CAEA,EADA;IAAyB,WAAW,AAApC,CACA,EADQ,OAAO,CACf;CAMU,GANA,MAAM,CAsClB;AAgBD;;;;;;;;;;GAUG;AACH,wBAAgB,2BAA2B,CAAC,OAAO,EAJxC,MAIwC,EAAE,KAAK,EAH/C,MAG+C,GAF7C,MAAM,CAsBlB;AAED;;;;;;;;GAQG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAHpC,MAGoC,GAFlC,OAAO,CAOnB"}
|