@trustify-da/trustify-da-javascript-client 0.3.0-ea.a783c26 → 0.3.0-ea.a87208f
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 +177 -3
- package/dist/package.json +27 -22
- package/dist/src/analysis.d.ts +14 -7
- package/dist/src/analysis.js +29 -13
- package/dist/src/cli.js +106 -2
- package/dist/src/cyclone_dx_sbom.d.ts +20 -1
- package/dist/src/cyclone_dx_sbom.js +68 -9
- package/dist/src/index.d.ts +74 -11
- package/dist/src/index.js +83 -29
- package/dist/src/license/index.d.ts +3 -3
- package/dist/src/license/index.js +4 -1
- package/dist/src/license/license_utils.js +4 -1
- package/dist/src/license/licenses_api.d.ts +2 -2
- package/dist/src/oci_image/images.d.ts +1 -1
- package/dist/src/oci_image/images.js +15 -1
- package/dist/src/oci_image/utils.d.ts +5 -5
- package/dist/src/package_version.d.ts +8 -0
- package/dist/src/package_version.js +31 -0
- package/dist/src/provider.d.ts +4 -3
- package/dist/src/provider.js +6 -2
- package/dist/src/providers/base_java.d.ts +67 -12
- package/dist/src/providers/base_java.js +82 -61
- package/dist/src/providers/base_javascript.d.ts +74 -9
- package/dist/src/providers/base_javascript.js +115 -6
- package/dist/src/providers/base_pyproject.d.ts +15 -6
- package/dist/src/providers/base_pyproject.js +12 -4
- package/dist/src/providers/containerfile_parser.d.ts +5 -0
- package/dist/src/providers/containerfile_parser.js +20 -0
- package/dist/src/providers/golang_gomodules.d.ts +11 -1
- package/dist/src/providers/golang_gomodules.js +108 -10
- package/dist/src/providers/java_gradle.d.ts +19 -0
- package/dist/src/providers/java_gradle.js +116 -2
- package/dist/src/providers/java_gradle_groovy.d.ts +1 -1
- package/dist/src/providers/java_gradle_kotlin.d.ts +1 -1
- package/dist/src/providers/java_maven.d.ts +38 -5
- package/dist/src/providers/java_maven.js +261 -8
- package/dist/src/providers/javascript_bun.d.ts +22 -0
- package/dist/src/providers/javascript_bun.js +141 -0
- package/dist/src/providers/javascript_npm.d.ts +19 -1
- package/dist/src/providers/javascript_npm.js +40 -1
- package/dist/src/providers/javascript_pnpm.d.ts +13 -0
- package/dist/src/providers/javascript_pnpm.js +53 -3
- package/dist/src/providers/javascript_yarn.d.ts +12 -0
- package/dist/src/providers/javascript_yarn.js +75 -2
- package/dist/src/providers/marker_evaluator.d.ts +14 -0
- package/dist/src/providers/marker_evaluator.js +191 -0
- package/dist/src/providers/oci_dockerfile.d.ts +51 -0
- package/dist/src/providers/oci_dockerfile.js +177 -0
- package/dist/src/providers/processors/yarn_berry_processor.d.ts +6 -2
- package/dist/src/providers/processors/yarn_berry_processor.js +3 -2
- package/dist/src/providers/processors/yarn_classic_processor.d.ts +6 -2
- package/dist/src/providers/processors/yarn_classic_processor.js +8 -6
- package/dist/src/providers/python_controller.d.ts +5 -1
- package/dist/src/providers/python_controller.js +62 -5
- package/dist/src/providers/python_pip.d.ts +5 -0
- package/dist/src/providers/python_pip.js +5 -5
- package/dist/src/providers/python_pip_pyproject.js +3 -1
- package/dist/src/providers/python_poetry.d.ts +63 -8
- package/dist/src/providers/python_poetry.js +132 -21
- package/dist/src/providers/python_uv.d.ts +20 -1
- package/dist/src/providers/python_uv.js +122 -2
- package/dist/src/providers/rust_cargo.d.ts +6 -2
- package/dist/src/providers/rust_cargo.js +105 -19
- package/dist/src/providers/tree-sitter-containerfile.wasm +0 -0
- package/dist/src/remediate.d.ts +21 -0
- package/dist/src/remediate.js +149 -0
- package/dist/src/remediation.d.ts +57 -0
- package/dist/src/remediation.js +436 -0
- package/dist/src/remediation_report.d.ts +40 -0
- package/dist/src/remediation_report.js +159 -0
- package/dist/src/sbom.d.ts +18 -1
- package/dist/src/sbom.js +14 -2
- package/dist/src/tools.d.ts +28 -2
- package/dist/src/tools.js +82 -1
- package/dist/src/updaters/maven_updater.d.ts +26 -0
- package/dist/src/updaters/maven_updater.js +322 -0
- package/dist/src/updaters/toml_updater.d.ts +33 -0
- package/dist/src/updaters/toml_updater.js +244 -0
- package/dist/src/workspace.d.ts +9 -0
- package/dist/src/workspace.js +1 -1
- package/package.json +28 -23
|
@@ -18,9 +18,27 @@ export default class CycloneDxSbom {
|
|
|
18
18
|
* Adds a dependency relationship between two components in the SBOM
|
|
19
19
|
* @param {PackageURL} sourceRef - The source component (parent)
|
|
20
20
|
* @param {PackageURL} targetRef - The target component (dependency)
|
|
21
|
+
* @param {string} [scope] - Scope of the dependency
|
|
22
|
+
* @param {Array<{alg: string, content: string}>} [targetHashes] - Optional hashes for the target component
|
|
21
23
|
* @return {CycloneDxSbom} The updated SBOM
|
|
22
24
|
*/
|
|
23
|
-
addDependency(sourceRef: PackageURL, targetRef: PackageURL, scope
|
|
25
|
+
addDependency(sourceRef: PackageURL, targetRef: PackageURL, scope?: string, targetHashes?: Array<{
|
|
26
|
+
alg: string;
|
|
27
|
+
content: string;
|
|
28
|
+
}>): CycloneDxSbom;
|
|
29
|
+
/**
|
|
30
|
+
* Attach hashes to already-added components by matching their PURL. This is a
|
|
31
|
+
* post-processing step so ecosystem-specific hash sources (e.g. Maven reading
|
|
32
|
+
* the local .m2 cache) can enrich the SBOM without threading their concern
|
|
33
|
+
* through the shared dependency-tree parser. Components without a matching
|
|
34
|
+
* entry, or whose hashes are already set, are left untouched.
|
|
35
|
+
* @param {Map<string, Array<{alg: string, content: string}>>} hashMap - PURL→hashes map
|
|
36
|
+
* @return {CycloneDxSbom} the updated SBOM
|
|
37
|
+
*/
|
|
38
|
+
attachHashes(hashMap: Map<string, Array<{
|
|
39
|
+
alg: string;
|
|
40
|
+
content: string;
|
|
41
|
+
}>>): CycloneDxSbom;
|
|
24
42
|
/** @param {{}} opts - various options, settings and configuration of application.
|
|
25
43
|
* @return String CycloneDx Sbom json object in a string format
|
|
26
44
|
*/
|
|
@@ -50,6 +68,7 @@ export default class CycloneDxSbom {
|
|
|
50
68
|
version: any;
|
|
51
69
|
scope: any;
|
|
52
70
|
licenses?: any;
|
|
71
|
+
hashes?: any;
|
|
53
72
|
};
|
|
54
73
|
/**
|
|
55
74
|
* This method gets an array of dependencies to be ignored, and remove all of them from CycloneDx Sbom
|
|
@@ -1,15 +1,23 @@
|
|
|
1
1
|
import { EOL } from "os";
|
|
2
2
|
import { PackageURL } from "packageurl-js";
|
|
3
|
+
import { getPackageVersion } from "./package_version.js";
|
|
4
|
+
/**
|
|
5
|
+
* This client's version, read once at module load, used to populate
|
|
6
|
+
* metadata.tools.components[].version in the generated SBOM.
|
|
7
|
+
* @type {string|undefined}
|
|
8
|
+
*/
|
|
9
|
+
const PACKAGE_VERSION = getPackageVersion();
|
|
3
10
|
/**
|
|
4
11
|
*
|
|
5
12
|
* @param component {PackageURL}
|
|
6
13
|
* @param type type of package - application or library
|
|
7
14
|
* @param scope scope of the component - runtime or compile
|
|
8
15
|
* @param licenses optional license string or array of licenses for the component
|
|
9
|
-
* @
|
|
16
|
+
* @param hashes optional array of hash objects for the component, e.g. [{alg: "SHA-256", content: "..."}]
|
|
17
|
+
* @return {{"bom-ref": string, name, purl: string, type, version, scope, licenses?, hashes?}}
|
|
10
18
|
* @private
|
|
11
19
|
*/
|
|
12
|
-
function getComponent(component, type, scope, licenses) {
|
|
20
|
+
function getComponent(component, type, scope, licenses, hashes) {
|
|
13
21
|
let componentObject;
|
|
14
22
|
if (component instanceof PackageURL) {
|
|
15
23
|
if (component.namespace) {
|
|
@@ -40,12 +48,24 @@ function getComponent(component, type, scope, licenses) {
|
|
|
40
48
|
// Add licenses if provided (CycloneDX format). Callers must provide valid SPDX identifiers.
|
|
41
49
|
if (licenses) {
|
|
42
50
|
const licenseArray = Array.isArray(licenses) ? licenses : [licenses];
|
|
43
|
-
|
|
51
|
+
const validLicenses = licenseArray
|
|
52
|
+
.map(lic => {
|
|
44
53
|
if (typeof lic === 'string') {
|
|
45
54
|
return { license: { id: lic } };
|
|
46
55
|
}
|
|
47
|
-
|
|
48
|
-
|
|
56
|
+
if (typeof lic === 'object' && lic !== null && ('license' in lic || 'expression' in lic)) {
|
|
57
|
+
return lic;
|
|
58
|
+
}
|
|
59
|
+
return null;
|
|
60
|
+
})
|
|
61
|
+
.filter(Boolean);
|
|
62
|
+
if (validLicenses.length > 0) {
|
|
63
|
+
componentObject.licenses = validLicenses;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
// Add hashes if provided (CycloneDX 1.4 format).
|
|
67
|
+
if (hashes && hashes.length > 0) {
|
|
68
|
+
componentObject.hashes = hashes;
|
|
49
69
|
}
|
|
50
70
|
return componentObject;
|
|
51
71
|
}
|
|
@@ -86,16 +106,24 @@ export default class CycloneDxSbom {
|
|
|
86
106
|
* Adds a dependency relationship between two components in the SBOM
|
|
87
107
|
* @param {PackageURL} sourceRef - The source component (parent)
|
|
88
108
|
* @param {PackageURL} targetRef - The target component (dependency)
|
|
109
|
+
* @param {string} [scope] - Scope of the dependency
|
|
110
|
+
* @param {Array<{alg: string, content: string}>} [targetHashes] - Optional hashes for the target component
|
|
89
111
|
* @return {CycloneDxSbom} The updated SBOM
|
|
90
112
|
*/
|
|
91
|
-
addDependency(sourceRef, targetRef, scope) {
|
|
113
|
+
addDependency(sourceRef, targetRef, scope, targetHashes) {
|
|
92
114
|
const sourcePurl = sourceRef.toString();
|
|
93
115
|
const targetPurl = targetRef.toString();
|
|
94
116
|
// Ensure both components exist in the components list
|
|
95
117
|
[sourceRef, targetRef].forEach((ref, index) => {
|
|
96
118
|
const purl = index === 0 ? sourcePurl : targetPurl;
|
|
97
|
-
|
|
98
|
-
|
|
119
|
+
const existingIndex = this.getComponentIndex(purl);
|
|
120
|
+
if (existingIndex < 0) {
|
|
121
|
+
const hashes = index === 1 ? targetHashes : undefined;
|
|
122
|
+
this.components.push(getComponent(ref, "library", scope, undefined, hashes));
|
|
123
|
+
}
|
|
124
|
+
else if (index === 1 && targetHashes && targetHashes.length > 0 && !this.components[existingIndex].hashes) {
|
|
125
|
+
// Update hashes if the component was first seen without them (e.g. as a source)
|
|
126
|
+
this.components[existingIndex].hashes = targetHashes;
|
|
99
127
|
}
|
|
100
128
|
});
|
|
101
129
|
// Ensure source dependency exists
|
|
@@ -114,6 +142,30 @@ export default class CycloneDxSbom {
|
|
|
114
142
|
}
|
|
115
143
|
return this;
|
|
116
144
|
}
|
|
145
|
+
/**
|
|
146
|
+
* Attach hashes to already-added components by matching their PURL. This is a
|
|
147
|
+
* post-processing step so ecosystem-specific hash sources (e.g. Maven reading
|
|
148
|
+
* the local .m2 cache) can enrich the SBOM without threading their concern
|
|
149
|
+
* through the shared dependency-tree parser. Components without a matching
|
|
150
|
+
* entry, or whose hashes are already set, are left untouched.
|
|
151
|
+
* @param {Map<string, Array<{alg: string, content: string}>>} hashMap - PURL→hashes map
|
|
152
|
+
* @return {CycloneDxSbom} the updated SBOM
|
|
153
|
+
*/
|
|
154
|
+
attachHashes(hashMap) {
|
|
155
|
+
if (!hashMap || hashMap.size === 0) {
|
|
156
|
+
return this;
|
|
157
|
+
}
|
|
158
|
+
for (const component of this.components) {
|
|
159
|
+
if (component.hashes) {
|
|
160
|
+
continue;
|
|
161
|
+
}
|
|
162
|
+
const hashes = hashMap.get(component.purl);
|
|
163
|
+
if (hashes && hashes.length > 0) {
|
|
164
|
+
component.hashes = hashes;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
return this;
|
|
168
|
+
}
|
|
117
169
|
/** @param {{}} opts - various options, settings and configuration of application.
|
|
118
170
|
* @return String CycloneDx Sbom json object in a string format
|
|
119
171
|
*/
|
|
@@ -123,11 +175,18 @@ export default class CycloneDxSbom {
|
|
|
123
175
|
const rootPurl = this.rootComponent?.purl;
|
|
124
176
|
this.sbomObject = {
|
|
125
177
|
"bomFormat": "CycloneDX",
|
|
126
|
-
"specVersion": "1.
|
|
178
|
+
"specVersion": "1.6",
|
|
127
179
|
"version": 1,
|
|
128
180
|
"metadata": {
|
|
129
181
|
"timestamp": new Date(),
|
|
130
182
|
"component": this.rootComponent,
|
|
183
|
+
"tools": {
|
|
184
|
+
"components": [{
|
|
185
|
+
"type": "application",
|
|
186
|
+
"name": "trustify-da-javascript-client",
|
|
187
|
+
"version": PACKAGE_VERSION
|
|
188
|
+
}]
|
|
189
|
+
},
|
|
131
190
|
"properties": new Array()
|
|
132
191
|
},
|
|
133
192
|
"components": this.components.filter(c => c.purl !== rootPurl),
|
package/dist/src/index.d.ts
CHANGED
|
@@ -24,6 +24,7 @@ export function selectTrustifyDABackend(opts?: {
|
|
|
24
24
|
export function generateSbom(manifestPath: string, opts?: Options): Promise<object>;
|
|
25
25
|
export { parseImageRef } from "./oci_image/utils.js";
|
|
26
26
|
export { ImageRef } from "./oci_image/images.js";
|
|
27
|
+
export { extractRemediations } from "./remediation.js";
|
|
27
28
|
declare namespace _default {
|
|
28
29
|
export { componentAnalysis };
|
|
29
30
|
export { stackAnalysis };
|
|
@@ -53,7 +54,9 @@ export type Options = {
|
|
|
53
54
|
TRUSTIFY_DA_PYTHON_PATH?: string | undefined;
|
|
54
55
|
TRUSTIFY_DA_PYTHON_VIRTUAL_ENV?: string | undefined;
|
|
55
56
|
TRUSTIFY_DA_PYTHON3_PATH?: string | undefined;
|
|
56
|
-
|
|
57
|
+
TRUSTIFY_DA_PROVIDERS?: string | undefined;
|
|
58
|
+
TRUSTIFY_DA_RECOMMEND?: string | undefined;
|
|
59
|
+
TRUSTIFY_DA_SOURCES?: string | undefined;
|
|
57
60
|
TRUSTIFY_DA_SKOPEO_CONFIG_PATH?: string | undefined;
|
|
58
61
|
TRUSTIFY_DA_SKOPEO_PATH?: string | undefined;
|
|
59
62
|
TRUSTIFY_DA_SYFT_CONFIG_PATH?: string | undefined;
|
|
@@ -80,7 +83,7 @@ export type Options = {
|
|
|
80
83
|
};
|
|
81
84
|
export type BatchAnalysisMetadata = {
|
|
82
85
|
workspaceRoot: string;
|
|
83
|
-
ecosystem: "javascript" | "cargo" | "unknown";
|
|
86
|
+
ecosystem: "javascript" | "cargo" | "pyproject" | "unknown";
|
|
84
87
|
total: number;
|
|
85
88
|
successful: number;
|
|
86
89
|
failed: number;
|
|
@@ -106,7 +109,7 @@ export type SbomResult = {
|
|
|
106
109
|
* @returns {Promise<import('@trustify-da/trustify-da-api-model/model/v5/AnalysisReport').AnalysisReport>}
|
|
107
110
|
* @throws {Error} if no matching provider, failed to get create content, or backend request failed
|
|
108
111
|
*/
|
|
109
|
-
declare function componentAnalysis(manifest: string, opts?: Options): Promise<
|
|
112
|
+
declare function componentAnalysis(manifest: string, opts?: Options): Promise<any>;
|
|
110
113
|
/**
|
|
111
114
|
* @overload
|
|
112
115
|
* @param {string} manifest
|
|
@@ -124,7 +127,7 @@ declare function stackAnalysis(manifest: string, html: true, opts?: Options | un
|
|
|
124
127
|
* @returns {Promise<import('@trustify-da/trustify-da-api-model/model/v5/AnalysisReport').AnalysisReport>}
|
|
125
128
|
* @throws {Error}
|
|
126
129
|
*/
|
|
127
|
-
declare function stackAnalysis(manifest: string, html: false, opts?: Options | undefined): Promise<
|
|
130
|
+
declare function stackAnalysis(manifest: string, html: false, opts?: Options | undefined): Promise<any>;
|
|
128
131
|
/**
|
|
129
132
|
* Get stack analysis report for a manifest file.
|
|
130
133
|
* @overload
|
|
@@ -135,24 +138,79 @@ declare function stackAnalysis(manifest: string, html: false, opts?: Options | u
|
|
|
135
138
|
* @throws {Error} if manifest inaccessible, no matching provider, failed to get create content,
|
|
136
139
|
* or backend request failed
|
|
137
140
|
*/
|
|
138
|
-
declare function stackAnalysis(manifest: string, html?: boolean | undefined, opts?: Options | undefined): Promise<string |
|
|
141
|
+
declare function stackAnalysis(manifest: string, html?: boolean | undefined, opts?: Options | undefined): Promise<string | any>;
|
|
142
|
+
/**
|
|
143
|
+
* @overload
|
|
144
|
+
* @param {string} workspaceRoot
|
|
145
|
+
* @param {true} html
|
|
146
|
+
* @param {Options & { batchMetadata: true }} opts
|
|
147
|
+
* @returns {Promise<{ analysis: string, metadata: BatchAnalysisMetadata }>}
|
|
148
|
+
* @throws {Error}
|
|
149
|
+
*/
|
|
150
|
+
declare function stackAnalysisBatch(workspaceRoot: string, html: true, opts: Options & {
|
|
151
|
+
batchMetadata: true;
|
|
152
|
+
}): Promise<{
|
|
153
|
+
analysis: string;
|
|
154
|
+
metadata: BatchAnalysisMetadata;
|
|
155
|
+
}>;
|
|
156
|
+
/**
|
|
157
|
+
* @overload
|
|
158
|
+
* @param {string} workspaceRoot
|
|
159
|
+
* @param {true} html
|
|
160
|
+
* @param {Options & { batchMetadata?: false }} [opts={}]
|
|
161
|
+
* @returns {Promise<string>}
|
|
162
|
+
* @throws {Error}
|
|
163
|
+
*/
|
|
164
|
+
declare function stackAnalysisBatch(workspaceRoot: string, html: true, opts?: (Options & {
|
|
165
|
+
batchMetadata?: false;
|
|
166
|
+
}) | undefined): Promise<string>;
|
|
167
|
+
/**
|
|
168
|
+
* @overload
|
|
169
|
+
* @param {string} workspaceRoot
|
|
170
|
+
* @param {false} html
|
|
171
|
+
* @param {Options & { batchMetadata: true }} opts
|
|
172
|
+
* @returns {Promise<{ analysis: Object.<string, import('@trustify-da/trustify-da-api-model/model/v5/AnalysisReport').AnalysisReport>, metadata: BatchAnalysisMetadata }>}
|
|
173
|
+
* @throws {Error}
|
|
174
|
+
*/
|
|
175
|
+
declare function stackAnalysisBatch(workspaceRoot: string, html: false, opts: Options & {
|
|
176
|
+
batchMetadata: true;
|
|
177
|
+
}): Promise<{
|
|
178
|
+
analysis: {
|
|
179
|
+
[x: string]: any;
|
|
180
|
+
};
|
|
181
|
+
metadata: BatchAnalysisMetadata;
|
|
182
|
+
}>;
|
|
183
|
+
/**
|
|
184
|
+
* @overload
|
|
185
|
+
* @param {string} workspaceRoot
|
|
186
|
+
* @param {false} html
|
|
187
|
+
* @param {Options & { batchMetadata?: false }} [opts={}]
|
|
188
|
+
* @returns {Promise<Object.<string, import('@trustify-da/trustify-da-api-model/model/v5/AnalysisReport').AnalysisReport>>}
|
|
189
|
+
* @throws {Error}
|
|
190
|
+
*/
|
|
191
|
+
declare function stackAnalysisBatch(workspaceRoot: string, html: false, opts?: (Options & {
|
|
192
|
+
batchMetadata?: false;
|
|
193
|
+
}) | undefined): Promise<{
|
|
194
|
+
[x: string]: any;
|
|
195
|
+
}>;
|
|
139
196
|
/**
|
|
140
197
|
* Get stack analysis for all workspace packages/crates (batch).
|
|
141
198
|
* Detects ecosystem from workspace root: Cargo (Cargo.toml + Cargo.lock) or JS/TS (package.json + lock file).
|
|
142
199
|
* SBOMs are generated in parallel (see `batchConcurrency`) unless `continueOnError: false` (fail-fast sequential).
|
|
143
200
|
* With `opts.batchMetadata` / `TRUSTIFY_DA_BATCH_METADATA`, returns `{ analysis, metadata }` including validation and SBOM errors.
|
|
144
201
|
*
|
|
202
|
+
* @overload
|
|
145
203
|
* @param {string} workspaceRoot - Path to workspace root (containing lock file and workspace config)
|
|
146
204
|
* @param {boolean} [html=false] - true returns HTML, false returns JSON report
|
|
147
205
|
* @param {Options} [opts={}] - `batchConcurrency`, discovery ignores, `continueOnError` (default true), `batchMetadata` (default false)
|
|
148
206
|
* @returns {Promise<string|Object.<string, import('@trustify-da/trustify-da-api-model/model/v5/AnalysisReport').AnalysisReport>|{ analysis: string|Object.<string, import('@trustify-da/trustify-da-api-model/model/v5/AnalysisReport').AnalysisReport>, metadata: BatchAnalysisMetadata }>}
|
|
149
207
|
* @throws {Error} if workspace root invalid, no manifests found, no packages pass validation, no SBOMs produced, or backend request failed. When `opts.batchMetadata` is set, `error.batchMetadata` may be set on thrown errors.
|
|
150
208
|
*/
|
|
151
|
-
declare function stackAnalysisBatch(workspaceRoot: string, html?: boolean, opts?: Options): Promise<string | {
|
|
152
|
-
[x: string]:
|
|
209
|
+
declare function stackAnalysisBatch(workspaceRoot: string, html?: boolean | undefined, opts?: Options | undefined): Promise<string | {
|
|
210
|
+
[x: string]: any;
|
|
153
211
|
} | {
|
|
154
212
|
analysis: string | {
|
|
155
|
-
[x: string]:
|
|
213
|
+
[x: string]: any;
|
|
156
214
|
};
|
|
157
215
|
metadata: BatchAnalysisMetadata;
|
|
158
216
|
}>;
|
|
@@ -174,7 +232,7 @@ declare function imageAnalysis(imageRefs: Array<string>, html: true, opts?: Opti
|
|
|
174
232
|
* @throws {Error}
|
|
175
233
|
*/
|
|
176
234
|
declare function imageAnalysis(imageRefs: Array<string>, html: false, opts?: Options | undefined): Promise<{
|
|
177
|
-
[x: string]:
|
|
235
|
+
[x: string]: any;
|
|
178
236
|
}>;
|
|
179
237
|
/**
|
|
180
238
|
* Get image analysis report for a set of OCI image references.
|
|
@@ -187,7 +245,7 @@ declare function imageAnalysis(imageRefs: Array<string>, html: false, opts?: Opt
|
|
|
187
245
|
* or backend request failed
|
|
188
246
|
*/
|
|
189
247
|
declare function imageAnalysis(imageRefs: Array<string>, html?: boolean | undefined, opts?: Options | undefined): Promise<string | {
|
|
190
|
-
[x: string]:
|
|
248
|
+
[x: string]: any;
|
|
191
249
|
}>;
|
|
192
250
|
/**
|
|
193
251
|
* Validates the Exhort token.
|
|
@@ -196,6 +254,10 @@ declare function imageAnalysis(imageRefs: Array<string>, html?: boolean | undefi
|
|
|
196
254
|
* @throws {Error} if the backend request failed.
|
|
197
255
|
*/
|
|
198
256
|
declare function validateToken(opts?: Options): Promise<object>;
|
|
257
|
+
import { discoverMavenModules } from './providers/java_maven.js';
|
|
258
|
+
import { discoverGradleSubprojects } from './providers/java_gradle.js';
|
|
259
|
+
import { discoverGoWorkspaceModules } from './providers/golang_gomodules.js';
|
|
260
|
+
import { discoverUvWorkspaceMembers } from './providers/python_uv.js';
|
|
199
261
|
import { discoverWorkspacePackages } from './workspace.js';
|
|
200
262
|
import { discoverWorkspaceCrates } from './workspace.js';
|
|
201
263
|
import { validatePackageJson } from './workspace.js';
|
|
@@ -203,5 +265,6 @@ import { resolveWorkspaceDiscoveryIgnore } from './workspace.js';
|
|
|
203
265
|
import { filterManifestPathsByDiscoveryIgnore } from './workspace.js';
|
|
204
266
|
import { resolveContinueOnError } from './batch_opts.js';
|
|
205
267
|
import { resolveBatchMetadata } from './batch_opts.js';
|
|
206
|
-
export { discoverWorkspacePackages, discoverWorkspaceCrates, validatePackageJson, resolveWorkspaceDiscoveryIgnore, filterManifestPathsByDiscoveryIgnore, resolveContinueOnError, resolveBatchMetadata };
|
|
268
|
+
export { discoverMavenModules, discoverGradleSubprojects, discoverGoWorkspaceModules, discoverUvWorkspaceMembers, discoverWorkspacePackages, discoverWorkspaceCrates, validatePackageJson, resolveWorkspaceDiscoveryIgnore, filterManifestPathsByDiscoveryIgnore, resolveContinueOnError, resolveBatchMetadata };
|
|
207
269
|
export { getProjectLicense, findLicenseFilePath, identifyLicense, getLicenseDetails, licensesFromReport, normalizeLicensesResponse, runLicenseCheck, getCompatibility } from "./license/index.js";
|
|
270
|
+
export { generateReport, generateDeduplicationKey } from "./remediation_report.js";
|
package/dist/src/index.js
CHANGED
|
@@ -1,19 +1,24 @@
|
|
|
1
|
+
import fs from 'node:fs';
|
|
1
2
|
import path from "node:path";
|
|
2
3
|
import { EOL } from "os";
|
|
3
4
|
import pLimit from 'p-limit';
|
|
4
|
-
import { availableProviders, match } from './provider.js';
|
|
5
5
|
import analysis from './analysis.js';
|
|
6
|
-
import fs from 'node:fs';
|
|
7
|
-
import { getCustom } from "./tools.js";
|
|
8
6
|
import { resolveBatchMetadata, resolveContinueOnError } from './batch_opts.js';
|
|
7
|
+
import { getPackageVersion } from './package_version.js';
|
|
8
|
+
import { availableProviders, match } from './provider.js';
|
|
9
|
+
import { discoverGoWorkspaceModules } from './providers/golang_gomodules.js';
|
|
10
|
+
import { discoverGradleSubprojects } from './providers/java_gradle.js';
|
|
11
|
+
import { discoverMavenModules } from './providers/java_maven.js';
|
|
12
|
+
import { discoverUvWorkspaceMembers } from './providers/python_uv.js';
|
|
13
|
+
import { getCustom } from "./tools.js";
|
|
9
14
|
import { discoverWorkspaceCrates, discoverWorkspacePackages, filterManifestPathsByDiscoveryIgnore, resolveWorkspaceDiscoveryIgnore, validatePackageJson, } from './workspace.js';
|
|
10
|
-
import.meta.dirname;
|
|
11
|
-
import * as url from 'url';
|
|
12
15
|
export { parseImageRef } from "./oci_image/utils.js";
|
|
13
16
|
export { ImageRef } from "./oci_image/images.js";
|
|
14
17
|
export { getProjectLicense, findLicenseFilePath, identifyLicense, getLicenseDetails, licensesFromReport, normalizeLicensesResponse, runLicenseCheck, getCompatibility } from "./license/index.js";
|
|
18
|
+
export { extractRemediations } from "./remediation.js";
|
|
19
|
+
export { generateReport, generateDeduplicationKey } from './remediation_report.js';
|
|
15
20
|
export default { componentAnalysis, stackAnalysis, stackAnalysisBatch, imageAnalysis, validateToken, generateSbom };
|
|
16
|
-
export { discoverWorkspacePackages, discoverWorkspaceCrates, validatePackageJson, resolveWorkspaceDiscoveryIgnore, filterManifestPathsByDiscoveryIgnore, resolveContinueOnError, resolveBatchMetadata, };
|
|
21
|
+
export { discoverMavenModules, discoverGradleSubprojects, discoverGoWorkspaceModules, discoverUvWorkspaceMembers, discoverWorkspacePackages, discoverWorkspaceCrates, validatePackageJson, resolveWorkspaceDiscoveryIgnore, filterManifestPathsByDiscoveryIgnore, resolveContinueOnError, resolveBatchMetadata, };
|
|
17
22
|
/**
|
|
18
23
|
* @typedef {{
|
|
19
24
|
* TRUSTIFY_DA_CARGO_PATH?: string | undefined,
|
|
@@ -35,7 +40,9 @@ export { discoverWorkspacePackages, discoverWorkspaceCrates, validatePackageJson
|
|
|
35
40
|
* TRUSTIFY_DA_PYTHON_PATH?: string | undefined,
|
|
36
41
|
* TRUSTIFY_DA_PYTHON_VIRTUAL_ENV?: string | undefined,
|
|
37
42
|
* TRUSTIFY_DA_PYTHON3_PATH?: string | undefined,
|
|
38
|
-
*
|
|
43
|
+
* TRUSTIFY_DA_PROVIDERS?: string | undefined,
|
|
44
|
+
* TRUSTIFY_DA_RECOMMEND?: string | undefined,
|
|
45
|
+
* TRUSTIFY_DA_SOURCES?: string | undefined,
|
|
39
46
|
* TRUSTIFY_DA_SKOPEO_CONFIG_PATH?: string | undefined,
|
|
40
47
|
* TRUSTIFY_DA_SKOPEO_PATH?: string | undefined,
|
|
41
48
|
* TRUSTIFY_DA_SYFT_CONFIG_PATH?: string | undefined,
|
|
@@ -64,7 +71,7 @@ export { discoverWorkspacePackages, discoverWorkspaceCrates, validatePackageJson
|
|
|
64
71
|
/**
|
|
65
72
|
* @typedef {{
|
|
66
73
|
* workspaceRoot: string,
|
|
67
|
-
* ecosystem: 'javascript' | 'cargo' | 'unknown',
|
|
74
|
+
* ecosystem: 'javascript' | 'cargo' | 'pyproject' | 'unknown',
|
|
68
75
|
* total: number,
|
|
69
76
|
* successful: number,
|
|
70
77
|
* failed: number,
|
|
@@ -87,23 +94,7 @@ function logOptionsAndEnvironmentsVariables(alongsideText, valueToBePrinted) {
|
|
|
87
94
|
* @private
|
|
88
95
|
*/
|
|
89
96
|
function readAndPrintVersionFromPackageJson() {
|
|
90
|
-
|
|
91
|
-
// new ESM way in nodeJS ( since node version 22 ) to bring module directory.
|
|
92
|
-
dirName = import.meta.dirname;
|
|
93
|
-
// old ESM way in nodeJS ( before node versions 22.00 to bring module directory)
|
|
94
|
-
if (!dirName) {
|
|
95
|
-
dirName = url.fileURLToPath(new URL('.', import.meta.url));
|
|
96
|
-
}
|
|
97
|
-
try {
|
|
98
|
-
if (__dirname) {
|
|
99
|
-
dirName = __dirname;
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
catch (e) {
|
|
103
|
-
console.log("__dirname is not defined, continue with fileUrlPath");
|
|
104
|
-
}
|
|
105
|
-
let packageJson = JSON.parse(fs.readFileSync(path.join(dirName, "..", "package.json")).toString());
|
|
106
|
-
logOptionsAndEnvironmentsVariables("trustify-da-javascript-client analysis started, version: ", packageJson.version);
|
|
97
|
+
logOptionsAndEnvironmentsVariables("trustify-da-javascript-client analysis started, version: ", getPackageVersion());
|
|
107
98
|
}
|
|
108
99
|
/**
|
|
109
100
|
* This function is used to determine the Trustify DA backend URL.
|
|
@@ -171,7 +162,9 @@ async function componentAnalysis(manifest, opts = {}) {
|
|
|
171
162
|
fs.accessSync(manifest, fs.constants.R_OK);
|
|
172
163
|
opts["manifest-type"] = path.basename(manifest);
|
|
173
164
|
let provider = match(manifest, availableProviders, opts); // throws error if no matching provider
|
|
174
|
-
|
|
165
|
+
const result = await analysis.requestComponent(provider, manifest, theUrl, opts); // throws error request sending failed
|
|
166
|
+
result.packageManager = provider.packageManagerName();
|
|
167
|
+
return result;
|
|
175
168
|
}
|
|
176
169
|
/**
|
|
177
170
|
* @overload
|
|
@@ -279,17 +272,45 @@ async function generateOneSbom(manifestPath, workspaceOpts) {
|
|
|
279
272
|
*
|
|
280
273
|
* @param {string} root - Resolved workspace root
|
|
281
274
|
* @param {Options} opts
|
|
282
|
-
* @returns {Promise<{ ecosystem: 'javascript' | 'cargo' | 'unknown', manifestPaths: string[] }>}
|
|
275
|
+
* @returns {Promise<{ ecosystem: 'javascript' | 'cargo' | 'maven' | 'gradle' | 'gomodules' | 'pyproject' | 'unknown', manifestPaths: string[] }>}
|
|
283
276
|
* @private
|
|
284
277
|
*/
|
|
285
278
|
async function detectWorkspaceManifests(root, opts) {
|
|
286
279
|
const cargoToml = path.join(root, 'Cargo.toml');
|
|
287
280
|
const cargoLock = path.join(root, 'Cargo.lock');
|
|
288
281
|
const packageJson = path.join(root, 'package.json');
|
|
282
|
+
const pomXml = path.join(root, 'pom.xml');
|
|
289
283
|
if (fs.existsSync(cargoToml) && fs.existsSync(cargoLock)) {
|
|
290
284
|
return { ecosystem: 'cargo', manifestPaths: await discoverWorkspaceCrates(root, opts) };
|
|
291
285
|
}
|
|
292
|
-
|
|
286
|
+
if (fs.existsSync(pomXml)) {
|
|
287
|
+
const manifestPaths = await discoverMavenModules(root, opts);
|
|
288
|
+
if (manifestPaths.length > 0) {
|
|
289
|
+
return { ecosystem: 'maven', manifestPaths };
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
const hasGradleSettings = fs.existsSync(path.join(root, 'settings.gradle'))
|
|
293
|
+
|| fs.existsSync(path.join(root, 'settings.gradle.kts'));
|
|
294
|
+
if (hasGradleSettings) {
|
|
295
|
+
const manifestPaths = await discoverGradleSubprojects(root, opts);
|
|
296
|
+
if (manifestPaths.length > 0) {
|
|
297
|
+
return { ecosystem: 'gradle', manifestPaths };
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
if (fs.existsSync(path.join(root, 'go.work'))) {
|
|
301
|
+
const manifestPaths = await discoverGoWorkspaceModules(root, opts);
|
|
302
|
+
if (manifestPaths.length > 0) {
|
|
303
|
+
return { ecosystem: 'gomodules', manifestPaths };
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
if (fs.existsSync(path.join(root, 'pyproject.toml')) && fs.existsSync(path.join(root, 'uv.lock'))) {
|
|
307
|
+
const manifestPaths = await discoverUvWorkspaceMembers(root, opts);
|
|
308
|
+
if (manifestPaths.length > 0) {
|
|
309
|
+
return { ecosystem: 'pyproject', manifestPaths };
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
const hasJsLock = fs.existsSync(path.join(root, 'bun.lock'))
|
|
313
|
+
|| fs.existsSync(path.join(root, 'pnpm-lock.yaml'))
|
|
293
314
|
|| fs.existsSync(path.join(root, 'yarn.lock'))
|
|
294
315
|
|| fs.existsSync(path.join(root, 'package-lock.json'));
|
|
295
316
|
if (fs.existsSync(packageJson) && hasJsLock) {
|
|
@@ -398,12 +419,45 @@ function batchError(message, wantMetadata, metadata) {
|
|
|
398
419
|
}
|
|
399
420
|
return err;
|
|
400
421
|
}
|
|
422
|
+
/**
|
|
423
|
+
* @overload
|
|
424
|
+
* @param {string} workspaceRoot
|
|
425
|
+
* @param {true} html
|
|
426
|
+
* @param {Options & { batchMetadata: true }} opts
|
|
427
|
+
* @returns {Promise<{ analysis: string, metadata: BatchAnalysisMetadata }>}
|
|
428
|
+
* @throws {Error}
|
|
429
|
+
*/
|
|
430
|
+
/**
|
|
431
|
+
* @overload
|
|
432
|
+
* @param {string} workspaceRoot
|
|
433
|
+
* @param {true} html
|
|
434
|
+
* @param {Options & { batchMetadata?: false }} [opts={}]
|
|
435
|
+
* @returns {Promise<string>}
|
|
436
|
+
* @throws {Error}
|
|
437
|
+
*/
|
|
438
|
+
/**
|
|
439
|
+
* @overload
|
|
440
|
+
* @param {string} workspaceRoot
|
|
441
|
+
* @param {false} html
|
|
442
|
+
* @param {Options & { batchMetadata: true }} opts
|
|
443
|
+
* @returns {Promise<{ analysis: Object.<string, import('@trustify-da/trustify-da-api-model/model/v5/AnalysisReport').AnalysisReport>, metadata: BatchAnalysisMetadata }>}
|
|
444
|
+
* @throws {Error}
|
|
445
|
+
*/
|
|
446
|
+
/**
|
|
447
|
+
* @overload
|
|
448
|
+
* @param {string} workspaceRoot
|
|
449
|
+
* @param {false} html
|
|
450
|
+
* @param {Options & { batchMetadata?: false }} [opts={}]
|
|
451
|
+
* @returns {Promise<Object.<string, import('@trustify-da/trustify-da-api-model/model/v5/AnalysisReport').AnalysisReport>>}
|
|
452
|
+
* @throws {Error}
|
|
453
|
+
*/
|
|
401
454
|
/**
|
|
402
455
|
* Get stack analysis for all workspace packages/crates (batch).
|
|
403
456
|
* Detects ecosystem from workspace root: Cargo (Cargo.toml + Cargo.lock) or JS/TS (package.json + lock file).
|
|
404
457
|
* SBOMs are generated in parallel (see `batchConcurrency`) unless `continueOnError: false` (fail-fast sequential).
|
|
405
458
|
* With `opts.batchMetadata` / `TRUSTIFY_DA_BATCH_METADATA`, returns `{ analysis, metadata }` including validation and SBOM errors.
|
|
406
459
|
*
|
|
460
|
+
* @overload
|
|
407
461
|
* @param {string} workspaceRoot - Path to workspace root (containing lock file and workspace config)
|
|
408
462
|
* @param {boolean} [html=false] - true returns HTML, false returns JSON report
|
|
409
463
|
* @param {Options} [opts={}] - `batchConcurrency`, discovery ignores, `continueOnError` (default true), `batchMetadata` (default false)
|
|
@@ -434,7 +488,7 @@ async function stackAnalysisBatch(workspaceRoot, html = false, opts = {}) {
|
|
|
434
488
|
}
|
|
435
489
|
}
|
|
436
490
|
if (manifestPaths.length === 0) {
|
|
437
|
-
throw new Error(`No workspace manifests found at ${root}. Ensure Cargo.toml+Cargo.lock or package.json+lock file
|
|
491
|
+
throw new Error(`No workspace manifests found at ${root}. Ensure a supported workspace root exists (Cargo.toml+Cargo.lock, pom.xml, build.gradle, go.work, pyproject.toml+uv.lock, or package.json+lock file).`);
|
|
438
492
|
}
|
|
439
493
|
const workspaceOpts = { ...opts, TRUSTIFY_DA_WORKSPACE_DIR: root };
|
|
440
494
|
const concurrency = resolveBatchConcurrency(opts);
|
|
@@ -9,10 +9,10 @@
|
|
|
9
9
|
* @param {import('@trustify-da/trustify-da-api-model/model/v5/AnalysisReport').AnalysisReport} [analysisResult] - analysis result that includes licenses array from backend
|
|
10
10
|
* @returns {Promise<{ projectLicense: { manifest: Object|null, file: Object|null, mismatch: boolean }, incompatibleDependencies: Array<{ purl: string, licenses: string[], category?: string, reason: string }>, error?: string }>}
|
|
11
11
|
*/
|
|
12
|
-
export function runLicenseCheck(sbomContent: string, manifestPath: string, url: string, opts?: import("../index.js").Options, analysisResult?:
|
|
12
|
+
export function runLicenseCheck(sbomContent: string, manifestPath: string, url: string, opts?: import("../index.js").Options, analysisResult?: any): Promise<{
|
|
13
13
|
projectLicense: {
|
|
14
|
-
manifest:
|
|
15
|
-
file:
|
|
14
|
+
manifest: Object | null;
|
|
15
|
+
file: Object | null;
|
|
16
16
|
mismatch: boolean;
|
|
17
17
|
};
|
|
18
18
|
incompatibleDependencies: Array<{
|
|
@@ -85,11 +85,14 @@ export async function runLicenseCheck(sbomContent, manifestPath, url, opts = {},
|
|
|
85
85
|
continue;
|
|
86
86
|
const status = getCompatibility(projectCategory, entry.category);
|
|
87
87
|
if (status === 'incompatible') {
|
|
88
|
+
const reason = entry.category?.toUpperCase() === 'UNKNOWN'
|
|
89
|
+
? 'License not recognized as a standard SPDX identifier. Manual review recommended to verify compatibility.'
|
|
90
|
+
: 'Dependency license(s) are incompatible with the project license.';
|
|
88
91
|
incompatibleDependencies.push({
|
|
89
92
|
purl,
|
|
90
93
|
licenses: entry.licenses,
|
|
91
94
|
category: entry.category,
|
|
92
|
-
reason
|
|
95
|
+
reason
|
|
93
96
|
});
|
|
94
97
|
}
|
|
95
98
|
}
|
|
@@ -114,9 +114,12 @@ export function getCompatibility(projectCategory, dependencyCategory) {
|
|
|
114
114
|
}
|
|
115
115
|
const proj = projectCategory.toUpperCase();
|
|
116
116
|
const dep = dependencyCategory.toUpperCase();
|
|
117
|
-
if (proj === 'UNKNOWN'
|
|
117
|
+
if (proj === 'UNKNOWN') {
|
|
118
118
|
return 'unknown';
|
|
119
119
|
}
|
|
120
|
+
if (dep === 'UNKNOWN') {
|
|
121
|
+
return 'incompatible';
|
|
122
|
+
}
|
|
120
123
|
const restrictiveness = {
|
|
121
124
|
'PERMISSIVE': 1,
|
|
122
125
|
'WEAK_COPYLEFT': 2,
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* @param {import('../index.js').Options} [opts={}] - options (proxy, token, TRUSTIFY_DA_BACKEND_URL, etc.)
|
|
7
7
|
* @returns {Promise<Object|null>} License details or null if not found
|
|
8
8
|
*/
|
|
9
|
-
export function getLicenseDetails(spdxId: string, opts?: import("../index.js").Options): Promise<
|
|
9
|
+
export function getLicenseDetails(spdxId: string, opts?: import("../index.js").Options): Promise<Object | null>;
|
|
10
10
|
/**
|
|
11
11
|
* Normalize the LicensesResponse shape (array of LicenseProviderResult) into a map of purl -> license info.
|
|
12
12
|
* Each provider result has { status, summary, packages } where packages is { [purl]: { concluded, evidence } }.
|
|
@@ -28,7 +28,7 @@ export function normalizeLicensesResponse(data: unknown, purls?: string[]): Map<
|
|
|
28
28
|
* @param {string[]} [purls] - optional list of purls to restrict to
|
|
29
29
|
* @returns {Map<string, { licenses: string[], category?: string }>}
|
|
30
30
|
*/
|
|
31
|
-
export function licensesFromReport(analysisReport:
|
|
31
|
+
export function licensesFromReport(analysisReport: any, purls?: string[]): Map<string, {
|
|
32
32
|
licenses: string[];
|
|
33
33
|
category?: string;
|
|
34
34
|
}>;
|
|
@@ -78,7 +78,7 @@ export class ImageRef {
|
|
|
78
78
|
* @param {string} [platform]
|
|
79
79
|
* @param {import("index.js").Options} [opts={}]
|
|
80
80
|
*/
|
|
81
|
-
constructor(image: string, platform?: string, opts?:
|
|
81
|
+
constructor(image: string, platform?: string, opts?: any);
|
|
82
82
|
/** @type {Image} */
|
|
83
83
|
image: Image;
|
|
84
84
|
/** @type {Platform} */
|
|
@@ -242,8 +242,22 @@ export class ImageRef {
|
|
|
242
242
|
getPackageURL() {
|
|
243
243
|
/** @type {Object.<string, string>} */
|
|
244
244
|
const qualifiers = {};
|
|
245
|
-
|
|
245
|
+
let repositoryUrl = this.image.getNameWithoutTag();
|
|
246
246
|
const simpleName = this.image.getSimpleName();
|
|
247
|
+
// Normalize Docker Hub image references so all forms produce the same PURL:
|
|
248
|
+
// node → docker.io/node
|
|
249
|
+
// docker.io/library/node → docker.io/node
|
|
250
|
+
if (repositoryUrl != null) {
|
|
251
|
+
const lower = repositoryUrl.toLowerCase();
|
|
252
|
+
if (lower === simpleName.toLowerCase()) {
|
|
253
|
+
// Bare name (e.g. "node") — default to docker.io
|
|
254
|
+
repositoryUrl = `docker.io/${simpleName}`;
|
|
255
|
+
}
|
|
256
|
+
else if (lower.startsWith('docker.io/library/')) {
|
|
257
|
+
// Official image with library/ prefix — strip it
|
|
258
|
+
repositoryUrl = `docker.io/${lower.substring('docker.io/library/'.length)}`;
|
|
259
|
+
}
|
|
260
|
+
}
|
|
247
261
|
if (repositoryUrl != null && repositoryUrl.toLowerCase() !== simpleName.toLowerCase()) {
|
|
248
262
|
qualifiers[ImageRef.REPOSITORY_QUALIFIER] = repositoryUrl.toLowerCase();
|
|
249
263
|
}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* @param {import("../index.js").Options} [opts={}] - optional various options to pass along the application
|
|
5
5
|
* @returns {{}}
|
|
6
6
|
*/
|
|
7
|
-
export function generateImageSBOM(imageRef:
|
|
7
|
+
export function generateImageSBOM(imageRef: any, opts?: import("../index.js").Options): {};
|
|
8
8
|
/**
|
|
9
9
|
*
|
|
10
10
|
* @param {string} image
|
|
@@ -25,7 +25,7 @@ export function getImagePlatform(opts?: import("../index.js").Options): Platform
|
|
|
25
25
|
* @returns {Object.<string, string>} - The image digests
|
|
26
26
|
* @throws {Error} If the image info is invalid
|
|
27
27
|
*/
|
|
28
|
-
export function getImageDigests(imageRef:
|
|
28
|
+
export function getImageDigests(imageRef: any, opts?: import("../index.js").Options): {
|
|
29
29
|
[x: string]: string;
|
|
30
30
|
};
|
|
31
31
|
export type SyftImageSource = {
|
|
@@ -34,9 +34,9 @@ export type SyftImageSource = {
|
|
|
34
34
|
getVariant: () => string;
|
|
35
35
|
};
|
|
36
36
|
export type SyftImageSourceType = {
|
|
37
|
-
getOs: (arg0:
|
|
38
|
-
getArch: (arg0:
|
|
39
|
-
getVariant: (arg0:
|
|
37
|
+
getOs: (arg0: Object) => string;
|
|
38
|
+
getArch: (arg0: Object) => string;
|
|
39
|
+
getVariant: (arg0: Object) => string;
|
|
40
40
|
};
|
|
41
41
|
import { ImageRef } from './images.js';
|
|
42
42
|
import { Platform } from './platform.js';
|