@trustify-da/trustify-da-javascript-client 0.3.0-ea.de12f6a → 0.3.0-ea.de62188
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 +57 -3
- package/dist/package.json +26 -23
- package/dist/src/analysis.d.ts +14 -7
- package/dist/src/analysis.js +32 -15
- package/dist/src/cli.js +109 -3
- package/dist/src/cyclone_dx_sbom.d.ts +14 -1
- package/dist/src/cyclone_dx_sbom.js +43 -8
- package/dist/src/index.d.ts +84 -11
- package/dist/src/index.js +95 -8
- 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/oci_image/utils.js +11 -2
- package/dist/src/provider.d.ts +4 -3
- package/dist/src/provider.js +12 -2
- package/dist/src/providers/base_java.d.ts +14 -12
- package/dist/src/providers/base_java.js +18 -44
- package/dist/src/providers/base_javascript.d.ts +20 -9
- package/dist/src/providers/base_javascript.js +44 -6
- package/dist/src/providers/base_pyproject.d.ts +158 -0
- package/dist/src/providers/base_pyproject.js +322 -0
- 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 +65 -8
- 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 +10 -2
- package/dist/src/providers/java_maven.js +165 -1
- package/dist/src/providers/javascript_bun.d.ts +10 -0
- package/dist/src/providers/javascript_bun.js +100 -0
- package/dist/src/providers/javascript_npm.d.ts +6 -0
- package/dist/src/providers/javascript_npm.js +21 -0
- package/dist/src/providers/javascript_pnpm.js +6 -2
- package/dist/src/providers/manifest.d.ts +2 -0
- package/dist/src/providers/manifest.js +22 -4
- 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 +2 -2
- package/dist/src/providers/processors/yarn_berry_processor.js +88 -5
- package/dist/src/providers/processors/yarn_classic_processor.d.ts +2 -2
- package/dist/src/providers/python_controller.d.ts +5 -1
- package/dist/src/providers/python_controller.js +65 -7
- 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.d.ts +61 -0
- package/dist/src/providers/python_pip_pyproject.js +146 -0
- package/dist/src/providers/python_poetry.d.ts +98 -0
- package/dist/src/providers/python_poetry.js +286 -0
- package/dist/src/providers/python_uv.d.ts +46 -0
- package/dist/src/providers/python_uv.js +269 -0
- package/dist/src/providers/rust_cargo.d.ts +6 -2
- package/dist/src/providers/rust_cargo.js +31 -4
- package/dist/src/providers/tree-sitter-containerfile.wasm +0 -0
- package/dist/src/sbom.d.ts +14 -1
- package/dist/src/sbom.js +13 -2
- package/dist/src/tools.d.ts +28 -2
- package/dist/src/tools.js +58 -0
- 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 +27 -24
|
@@ -6,10 +6,11 @@ import { PackageURL } from "packageurl-js";
|
|
|
6
6
|
* @param type type of package - application or library
|
|
7
7
|
* @param scope scope of the component - runtime or compile
|
|
8
8
|
* @param licenses optional license string or array of licenses for the component
|
|
9
|
-
* @
|
|
9
|
+
* @param hashes optional array of hash objects for the component, e.g. [{alg: "SHA-256", content: "..."}]
|
|
10
|
+
* @return {{"bom-ref": string, name, purl: string, type, version, scope, licenses?, hashes?}}
|
|
10
11
|
* @private
|
|
11
12
|
*/
|
|
12
|
-
function getComponent(component, type, scope, licenses) {
|
|
13
|
+
function getComponent(component, type, scope, licenses, hashes) {
|
|
13
14
|
let componentObject;
|
|
14
15
|
if (component instanceof PackageURL) {
|
|
15
16
|
if (component.namespace) {
|
|
@@ -40,12 +41,24 @@ function getComponent(component, type, scope, licenses) {
|
|
|
40
41
|
// Add licenses if provided (CycloneDX format). Callers must provide valid SPDX identifiers.
|
|
41
42
|
if (licenses) {
|
|
42
43
|
const licenseArray = Array.isArray(licenses) ? licenses : [licenses];
|
|
43
|
-
|
|
44
|
+
const validLicenses = licenseArray
|
|
45
|
+
.map(lic => {
|
|
44
46
|
if (typeof lic === 'string') {
|
|
45
47
|
return { license: { id: lic } };
|
|
46
48
|
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
+
if (typeof lic === 'object' && lic !== null && ('license' in lic || 'expression' in lic)) {
|
|
50
|
+
return lic;
|
|
51
|
+
}
|
|
52
|
+
return null;
|
|
53
|
+
})
|
|
54
|
+
.filter(Boolean);
|
|
55
|
+
if (validLicenses.length > 0) {
|
|
56
|
+
componentObject.licenses = validLicenses;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
// Add hashes if provided (CycloneDX 1.4 format).
|
|
60
|
+
if (hashes && hashes.length > 0) {
|
|
61
|
+
componentObject.hashes = hashes;
|
|
49
62
|
}
|
|
50
63
|
return componentObject;
|
|
51
64
|
}
|
|
@@ -86,16 +99,24 @@ export default class CycloneDxSbom {
|
|
|
86
99
|
* Adds a dependency relationship between two components in the SBOM
|
|
87
100
|
* @param {PackageURL} sourceRef - The source component (parent)
|
|
88
101
|
* @param {PackageURL} targetRef - The target component (dependency)
|
|
102
|
+
* @param {string} [scope] - Scope of the dependency
|
|
103
|
+
* @param {Array<{alg: string, content: string}>} [targetHashes] - Optional hashes for the target component
|
|
89
104
|
* @return {CycloneDxSbom} The updated SBOM
|
|
90
105
|
*/
|
|
91
|
-
addDependency(sourceRef, targetRef, scope) {
|
|
106
|
+
addDependency(sourceRef, targetRef, scope, targetHashes) {
|
|
92
107
|
const sourcePurl = sourceRef.toString();
|
|
93
108
|
const targetPurl = targetRef.toString();
|
|
94
109
|
// Ensure both components exist in the components list
|
|
95
110
|
[sourceRef, targetRef].forEach((ref, index) => {
|
|
96
111
|
const purl = index === 0 ? sourcePurl : targetPurl;
|
|
97
|
-
|
|
98
|
-
|
|
112
|
+
const existingIndex = this.getComponentIndex(purl);
|
|
113
|
+
if (existingIndex < 0) {
|
|
114
|
+
const hashes = index === 1 ? targetHashes : undefined;
|
|
115
|
+
this.components.push(getComponent(ref, "library", scope, undefined, hashes));
|
|
116
|
+
}
|
|
117
|
+
else if (index === 1 && targetHashes && targetHashes.length > 0 && !this.components[existingIndex].hashes) {
|
|
118
|
+
// Update hashes if the component was first seen without them (e.g. as a source)
|
|
119
|
+
this.components[existingIndex].hashes = targetHashes;
|
|
99
120
|
}
|
|
100
121
|
});
|
|
101
122
|
// Ensure source dependency exists
|
|
@@ -242,6 +263,20 @@ export default class CycloneDxSbom {
|
|
|
242
263
|
return false;
|
|
243
264
|
}
|
|
244
265
|
}
|
|
266
|
+
/**
|
|
267
|
+
* Checks if any entry in the dependsOn list of sourceRef starts with the given purl prefix.
|
|
268
|
+
* @param {PackageURL} sourceRef - The source component
|
|
269
|
+
* @param {string} purlPrefix - The purl prefix to match (e.g. "pkg:npm/minimist@")
|
|
270
|
+
* @return {boolean}
|
|
271
|
+
*/
|
|
272
|
+
checkDependsOnByPurlPrefix(sourceRef, purlPrefix) {
|
|
273
|
+
const sourcePurl = sourceRef.toString();
|
|
274
|
+
const depIndex = this.getDependencyIndex(sourcePurl);
|
|
275
|
+
if (depIndex < 0) {
|
|
276
|
+
return false;
|
|
277
|
+
}
|
|
278
|
+
return this.dependencies[depIndex].dependsOn.some(dep => dep.startsWith(purlPrefix));
|
|
279
|
+
}
|
|
245
280
|
/** Removes the root component from the sbom
|
|
246
281
|
*/
|
|
247
282
|
removeRootComponent() {
|
package/dist/src/index.d.ts
CHANGED
|
@@ -13,6 +13,15 @@ export function selectTrustifyDABackend(opts?: {
|
|
|
13
13
|
TRUSTIFY_DA_DEBUG?: string | undefined;
|
|
14
14
|
TRUSTIFY_DA_BACKEND_URL?: string | undefined;
|
|
15
15
|
}): string;
|
|
16
|
+
/**
|
|
17
|
+
* Generate a CycloneDX SBOM from a manifest file. No backend HTTP request is made.
|
|
18
|
+
*
|
|
19
|
+
* @param {string} manifestPath - path to the manifest file (e.g. pom.xml, package.json)
|
|
20
|
+
* @param {Options} [opts={}] - optional options (e.g. workspace dir, tool paths)
|
|
21
|
+
* @returns {Promise<object>} parsed CycloneDX SBOM JSON object
|
|
22
|
+
* @throws {Error} if the manifest is unsupported or SBOM generation fails
|
|
23
|
+
*/
|
|
24
|
+
export function generateSbom(manifestPath: string, opts?: Options): Promise<object>;
|
|
16
25
|
export { parseImageRef } from "./oci_image/utils.js";
|
|
17
26
|
export { ImageRef } from "./oci_image/images.js";
|
|
18
27
|
declare namespace _default {
|
|
@@ -21,6 +30,7 @@ declare namespace _default {
|
|
|
21
30
|
export { stackAnalysisBatch };
|
|
22
31
|
export { imageAnalysis };
|
|
23
32
|
export { validateToken };
|
|
33
|
+
export { generateSbom };
|
|
24
34
|
}
|
|
25
35
|
export default _default;
|
|
26
36
|
export type Options = {
|
|
@@ -43,7 +53,9 @@ export type Options = {
|
|
|
43
53
|
TRUSTIFY_DA_PYTHON_PATH?: string | undefined;
|
|
44
54
|
TRUSTIFY_DA_PYTHON_VIRTUAL_ENV?: string | undefined;
|
|
45
55
|
TRUSTIFY_DA_PYTHON3_PATH?: string | undefined;
|
|
46
|
-
|
|
56
|
+
TRUSTIFY_DA_PROVIDERS?: string | undefined;
|
|
57
|
+
TRUSTIFY_DA_RECOMMEND?: string | undefined;
|
|
58
|
+
TRUSTIFY_DA_SOURCES?: string | undefined;
|
|
47
59
|
TRUSTIFY_DA_SKOPEO_CONFIG_PATH?: string | undefined;
|
|
48
60
|
TRUSTIFY_DA_SKOPEO_PATH?: string | undefined;
|
|
49
61
|
TRUSTIFY_DA_SYFT_CONFIG_PATH?: string | undefined;
|
|
@@ -64,11 +76,13 @@ export type Options = {
|
|
|
64
76
|
TRUSTIFY_DA_CONTINUE_ON_ERROR?: string | undefined;
|
|
65
77
|
batchMetadata?: boolean | undefined;
|
|
66
78
|
TRUSTIFY_DA_BATCH_METADATA?: string | undefined;
|
|
79
|
+
TRUSTIFY_DA_UV_PATH?: string | undefined;
|
|
80
|
+
TRUSTIFY_DA_POETRY_PATH?: string | undefined;
|
|
67
81
|
[key: string]: string | number | boolean | string[] | undefined;
|
|
68
82
|
};
|
|
69
83
|
export type BatchAnalysisMetadata = {
|
|
70
84
|
workspaceRoot: string;
|
|
71
|
-
ecosystem: "javascript" | "cargo" | "unknown";
|
|
85
|
+
ecosystem: "javascript" | "cargo" | "pyproject" | "unknown";
|
|
72
86
|
total: number;
|
|
73
87
|
successful: number;
|
|
74
88
|
failed: number;
|
|
@@ -94,7 +108,7 @@ export type SbomResult = {
|
|
|
94
108
|
* @returns {Promise<import('@trustify-da/trustify-da-api-model/model/v5/AnalysisReport').AnalysisReport>}
|
|
95
109
|
* @throws {Error} if no matching provider, failed to get create content, or backend request failed
|
|
96
110
|
*/
|
|
97
|
-
declare function componentAnalysis(manifest: string, opts?: Options): Promise<
|
|
111
|
+
declare function componentAnalysis(manifest: string, opts?: Options): Promise<any>;
|
|
98
112
|
/**
|
|
99
113
|
* @overload
|
|
100
114
|
* @param {string} manifest
|
|
@@ -112,7 +126,7 @@ declare function stackAnalysis(manifest: string, html: true, opts?: Options | un
|
|
|
112
126
|
* @returns {Promise<import('@trustify-da/trustify-da-api-model/model/v5/AnalysisReport').AnalysisReport>}
|
|
113
127
|
* @throws {Error}
|
|
114
128
|
*/
|
|
115
|
-
declare function stackAnalysis(manifest: string, html: false, opts?: Options | undefined): Promise<
|
|
129
|
+
declare function stackAnalysis(manifest: string, html: false, opts?: Options | undefined): Promise<any>;
|
|
116
130
|
/**
|
|
117
131
|
* Get stack analysis report for a manifest file.
|
|
118
132
|
* @overload
|
|
@@ -123,24 +137,79 @@ declare function stackAnalysis(manifest: string, html: false, opts?: Options | u
|
|
|
123
137
|
* @throws {Error} if manifest inaccessible, no matching provider, failed to get create content,
|
|
124
138
|
* or backend request failed
|
|
125
139
|
*/
|
|
126
|
-
declare function stackAnalysis(manifest: string, html?: boolean | undefined, opts?: Options | undefined): Promise<string |
|
|
140
|
+
declare function stackAnalysis(manifest: string, html?: boolean | undefined, opts?: Options | undefined): Promise<string | any>;
|
|
141
|
+
/**
|
|
142
|
+
* @overload
|
|
143
|
+
* @param {string} workspaceRoot
|
|
144
|
+
* @param {true} html
|
|
145
|
+
* @param {Options & { batchMetadata: true }} opts
|
|
146
|
+
* @returns {Promise<{ analysis: string, metadata: BatchAnalysisMetadata }>}
|
|
147
|
+
* @throws {Error}
|
|
148
|
+
*/
|
|
149
|
+
declare function stackAnalysisBatch(workspaceRoot: string, html: true, opts: Options & {
|
|
150
|
+
batchMetadata: true;
|
|
151
|
+
}): Promise<{
|
|
152
|
+
analysis: string;
|
|
153
|
+
metadata: BatchAnalysisMetadata;
|
|
154
|
+
}>;
|
|
155
|
+
/**
|
|
156
|
+
* @overload
|
|
157
|
+
* @param {string} workspaceRoot
|
|
158
|
+
* @param {true} html
|
|
159
|
+
* @param {Options & { batchMetadata?: false }} [opts={}]
|
|
160
|
+
* @returns {Promise<string>}
|
|
161
|
+
* @throws {Error}
|
|
162
|
+
*/
|
|
163
|
+
declare function stackAnalysisBatch(workspaceRoot: string, html: true, opts?: (Options & {
|
|
164
|
+
batchMetadata?: false;
|
|
165
|
+
}) | undefined): Promise<string>;
|
|
166
|
+
/**
|
|
167
|
+
* @overload
|
|
168
|
+
* @param {string} workspaceRoot
|
|
169
|
+
* @param {false} html
|
|
170
|
+
* @param {Options & { batchMetadata: true }} opts
|
|
171
|
+
* @returns {Promise<{ analysis: Object.<string, import('@trustify-da/trustify-da-api-model/model/v5/AnalysisReport').AnalysisReport>, metadata: BatchAnalysisMetadata }>}
|
|
172
|
+
* @throws {Error}
|
|
173
|
+
*/
|
|
174
|
+
declare function stackAnalysisBatch(workspaceRoot: string, html: false, opts: Options & {
|
|
175
|
+
batchMetadata: true;
|
|
176
|
+
}): Promise<{
|
|
177
|
+
analysis: {
|
|
178
|
+
[x: string]: any;
|
|
179
|
+
};
|
|
180
|
+
metadata: BatchAnalysisMetadata;
|
|
181
|
+
}>;
|
|
182
|
+
/**
|
|
183
|
+
* @overload
|
|
184
|
+
* @param {string} workspaceRoot
|
|
185
|
+
* @param {false} html
|
|
186
|
+
* @param {Options & { batchMetadata?: false }} [opts={}]
|
|
187
|
+
* @returns {Promise<Object.<string, import('@trustify-da/trustify-da-api-model/model/v5/AnalysisReport').AnalysisReport>>}
|
|
188
|
+
* @throws {Error}
|
|
189
|
+
*/
|
|
190
|
+
declare function stackAnalysisBatch(workspaceRoot: string, html: false, opts?: (Options & {
|
|
191
|
+
batchMetadata?: false;
|
|
192
|
+
}) | undefined): Promise<{
|
|
193
|
+
[x: string]: any;
|
|
194
|
+
}>;
|
|
127
195
|
/**
|
|
128
196
|
* Get stack analysis for all workspace packages/crates (batch).
|
|
129
197
|
* Detects ecosystem from workspace root: Cargo (Cargo.toml + Cargo.lock) or JS/TS (package.json + lock file).
|
|
130
198
|
* SBOMs are generated in parallel (see `batchConcurrency`) unless `continueOnError: false` (fail-fast sequential).
|
|
131
199
|
* With `opts.batchMetadata` / `TRUSTIFY_DA_BATCH_METADATA`, returns `{ analysis, metadata }` including validation and SBOM errors.
|
|
132
200
|
*
|
|
201
|
+
* @overload
|
|
133
202
|
* @param {string} workspaceRoot - Path to workspace root (containing lock file and workspace config)
|
|
134
203
|
* @param {boolean} [html=false] - true returns HTML, false returns JSON report
|
|
135
204
|
* @param {Options} [opts={}] - `batchConcurrency`, discovery ignores, `continueOnError` (default true), `batchMetadata` (default false)
|
|
136
205
|
* @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 }>}
|
|
137
206
|
* @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.
|
|
138
207
|
*/
|
|
139
|
-
declare function stackAnalysisBatch(workspaceRoot: string, html?: boolean, opts?: Options): Promise<string | {
|
|
140
|
-
[x: string]:
|
|
208
|
+
declare function stackAnalysisBatch(workspaceRoot: string, html?: boolean | undefined, opts?: Options | undefined): Promise<string | {
|
|
209
|
+
[x: string]: any;
|
|
141
210
|
} | {
|
|
142
211
|
analysis: string | {
|
|
143
|
-
[x: string]:
|
|
212
|
+
[x: string]: any;
|
|
144
213
|
};
|
|
145
214
|
metadata: BatchAnalysisMetadata;
|
|
146
215
|
}>;
|
|
@@ -162,7 +231,7 @@ declare function imageAnalysis(imageRefs: Array<string>, html: true, opts?: Opti
|
|
|
162
231
|
* @throws {Error}
|
|
163
232
|
*/
|
|
164
233
|
declare function imageAnalysis(imageRefs: Array<string>, html: false, opts?: Options | undefined): Promise<{
|
|
165
|
-
[x: string]:
|
|
234
|
+
[x: string]: any;
|
|
166
235
|
}>;
|
|
167
236
|
/**
|
|
168
237
|
* Get image analysis report for a set of OCI image references.
|
|
@@ -175,7 +244,7 @@ declare function imageAnalysis(imageRefs: Array<string>, html: false, opts?: Opt
|
|
|
175
244
|
* or backend request failed
|
|
176
245
|
*/
|
|
177
246
|
declare function imageAnalysis(imageRefs: Array<string>, html?: boolean | undefined, opts?: Options | undefined): Promise<string | {
|
|
178
|
-
[x: string]:
|
|
247
|
+
[x: string]: any;
|
|
179
248
|
}>;
|
|
180
249
|
/**
|
|
181
250
|
* Validates the Exhort token.
|
|
@@ -184,6 +253,10 @@ declare function imageAnalysis(imageRefs: Array<string>, html?: boolean | undefi
|
|
|
184
253
|
* @throws {Error} if the backend request failed.
|
|
185
254
|
*/
|
|
186
255
|
declare function validateToken(opts?: Options): Promise<object>;
|
|
256
|
+
import { discoverMavenModules } from './providers/java_maven.js';
|
|
257
|
+
import { discoverGradleSubprojects } from './providers/java_gradle.js';
|
|
258
|
+
import { discoverGoWorkspaceModules } from './providers/golang_gomodules.js';
|
|
259
|
+
import { discoverUvWorkspaceMembers } from './providers/python_uv.js';
|
|
187
260
|
import { discoverWorkspacePackages } from './workspace.js';
|
|
188
261
|
import { discoverWorkspaceCrates } from './workspace.js';
|
|
189
262
|
import { validatePackageJson } from './workspace.js';
|
|
@@ -191,5 +264,5 @@ import { resolveWorkspaceDiscoveryIgnore } from './workspace.js';
|
|
|
191
264
|
import { filterManifestPathsByDiscoveryIgnore } from './workspace.js';
|
|
192
265
|
import { resolveContinueOnError } from './batch_opts.js';
|
|
193
266
|
import { resolveBatchMetadata } from './batch_opts.js';
|
|
194
|
-
export { discoverWorkspacePackages, discoverWorkspaceCrates, validatePackageJson, resolveWorkspaceDiscoveryIgnore, filterManifestPathsByDiscoveryIgnore, resolveContinueOnError, resolveBatchMetadata };
|
|
267
|
+
export { discoverMavenModules, discoverGradleSubprojects, discoverGoWorkspaceModules, discoverUvWorkspaceMembers, discoverWorkspacePackages, discoverWorkspaceCrates, validatePackageJson, resolveWorkspaceDiscoveryIgnore, filterManifestPathsByDiscoveryIgnore, resolveContinueOnError, resolveBatchMetadata };
|
|
195
268
|
export { getProjectLicense, findLicenseFilePath, identifyLicense, getLicenseDetails, licensesFromReport, normalizeLicensesResponse, runLicenseCheck, getCompatibility } from "./license/index.js";
|
package/dist/src/index.js
CHANGED
|
@@ -6,14 +6,18 @@ import analysis from './analysis.js';
|
|
|
6
6
|
import fs from 'node:fs';
|
|
7
7
|
import { getCustom } from "./tools.js";
|
|
8
8
|
import { resolveBatchMetadata, resolveContinueOnError } from './batch_opts.js';
|
|
9
|
+
import { discoverMavenModules } from './providers/java_maven.js';
|
|
10
|
+
import { discoverGradleSubprojects } from './providers/java_gradle.js';
|
|
11
|
+
import { discoverGoWorkspaceModules } from './providers/golang_gomodules.js';
|
|
12
|
+
import { discoverUvWorkspaceMembers } from './providers/python_uv.js';
|
|
9
13
|
import { discoverWorkspaceCrates, discoverWorkspacePackages, filterManifestPathsByDiscoveryIgnore, resolveWorkspaceDiscoveryIgnore, validatePackageJson, } from './workspace.js';
|
|
10
14
|
import.meta.dirname;
|
|
11
15
|
import * as url from 'url';
|
|
12
16
|
export { parseImageRef } from "./oci_image/utils.js";
|
|
13
17
|
export { ImageRef } from "./oci_image/images.js";
|
|
14
18
|
export { getProjectLicense, findLicenseFilePath, identifyLicense, getLicenseDetails, licensesFromReport, normalizeLicensesResponse, runLicenseCheck, getCompatibility } from "./license/index.js";
|
|
15
|
-
export default { componentAnalysis, stackAnalysis, stackAnalysisBatch, imageAnalysis, validateToken };
|
|
16
|
-
export { discoverWorkspacePackages, discoverWorkspaceCrates, validatePackageJson, resolveWorkspaceDiscoveryIgnore, filterManifestPathsByDiscoveryIgnore, resolveContinueOnError, resolveBatchMetadata, };
|
|
19
|
+
export default { componentAnalysis, stackAnalysis, stackAnalysisBatch, imageAnalysis, validateToken, generateSbom };
|
|
20
|
+
export { discoverMavenModules, discoverGradleSubprojects, discoverGoWorkspaceModules, discoverUvWorkspaceMembers, discoverWorkspacePackages, discoverWorkspaceCrates, validatePackageJson, resolveWorkspaceDiscoveryIgnore, filterManifestPathsByDiscoveryIgnore, resolveContinueOnError, resolveBatchMetadata, };
|
|
17
21
|
/**
|
|
18
22
|
* @typedef {{
|
|
19
23
|
* TRUSTIFY_DA_CARGO_PATH?: string | undefined,
|
|
@@ -35,7 +39,9 @@ export { discoverWorkspacePackages, discoverWorkspaceCrates, validatePackageJson
|
|
|
35
39
|
* TRUSTIFY_DA_PYTHON_PATH?: string | undefined,
|
|
36
40
|
* TRUSTIFY_DA_PYTHON_VIRTUAL_ENV?: string | undefined,
|
|
37
41
|
* TRUSTIFY_DA_PYTHON3_PATH?: string | undefined,
|
|
38
|
-
*
|
|
42
|
+
* TRUSTIFY_DA_PROVIDERS?: string | undefined,
|
|
43
|
+
* TRUSTIFY_DA_RECOMMEND?: string | undefined,
|
|
44
|
+
* TRUSTIFY_DA_SOURCES?: string | undefined,
|
|
39
45
|
* TRUSTIFY_DA_SKOPEO_CONFIG_PATH?: string | undefined,
|
|
40
46
|
* TRUSTIFY_DA_SKOPEO_PATH?: string | undefined,
|
|
41
47
|
* TRUSTIFY_DA_SYFT_CONFIG_PATH?: string | undefined,
|
|
@@ -56,13 +62,15 @@ export { discoverWorkspacePackages, discoverWorkspaceCrates, validatePackageJson
|
|
|
56
62
|
* TRUSTIFY_DA_CONTINUE_ON_ERROR?: string | undefined,
|
|
57
63
|
* batchMetadata?: boolean | undefined,
|
|
58
64
|
* TRUSTIFY_DA_BATCH_METADATA?: string | undefined,
|
|
65
|
+
* TRUSTIFY_DA_UV_PATH?: string | undefined,
|
|
66
|
+
* TRUSTIFY_DA_POETRY_PATH?: string | undefined,
|
|
59
67
|
* [key: string]: string | number | boolean | string[] | undefined,
|
|
60
68
|
* }} Options
|
|
61
69
|
*/
|
|
62
70
|
/**
|
|
63
71
|
* @typedef {{
|
|
64
72
|
* workspaceRoot: string,
|
|
65
|
-
* ecosystem: 'javascript' | 'cargo' | 'unknown',
|
|
73
|
+
* ecosystem: 'javascript' | 'cargo' | 'pyproject' | 'unknown',
|
|
66
74
|
* total: number,
|
|
67
75
|
* successful: number,
|
|
68
76
|
* failed: number,
|
|
@@ -169,7 +177,9 @@ async function componentAnalysis(manifest, opts = {}) {
|
|
|
169
177
|
fs.accessSync(manifest, fs.constants.R_OK);
|
|
170
178
|
opts["manifest-type"] = path.basename(manifest);
|
|
171
179
|
let provider = match(manifest, availableProviders, opts); // throws error if no matching provider
|
|
172
|
-
|
|
180
|
+
const result = await analysis.requestComponent(provider, manifest, theUrl, opts); // throws error request sending failed
|
|
181
|
+
result.packageManager = provider.packageManagerName();
|
|
182
|
+
return result;
|
|
173
183
|
}
|
|
174
184
|
/**
|
|
175
185
|
* @overload
|
|
@@ -235,6 +245,22 @@ function buildBatchAnalysisMetadata(root, ecosystem, totalSbomAttempts, successf
|
|
|
235
245
|
errors: [...errors],
|
|
236
246
|
};
|
|
237
247
|
}
|
|
248
|
+
/**
|
|
249
|
+
* Generate a CycloneDX SBOM from a manifest file. No backend HTTP request is made.
|
|
250
|
+
*
|
|
251
|
+
* @param {string} manifestPath - path to the manifest file (e.g. pom.xml, package.json)
|
|
252
|
+
* @param {Options} [opts={}] - optional options (e.g. workspace dir, tool paths)
|
|
253
|
+
* @returns {Promise<object>} parsed CycloneDX SBOM JSON object
|
|
254
|
+
* @throws {Error} if the manifest is unsupported or SBOM generation fails
|
|
255
|
+
*/
|
|
256
|
+
export async function generateSbom(manifestPath, opts = {}) {
|
|
257
|
+
fs.accessSync(manifestPath, fs.constants.R_OK);
|
|
258
|
+
const result = await generateOneSbom(manifestPath, opts);
|
|
259
|
+
if (!result.ok) {
|
|
260
|
+
throw new Error(`Failed to generate SBOM for ${result.manifestPath}: ${result.reason}`);
|
|
261
|
+
}
|
|
262
|
+
return result.sbom;
|
|
263
|
+
}
|
|
238
264
|
/**
|
|
239
265
|
* @typedef {{ ok: true, purl: string, sbom: object } | { ok: false, manifestPath: string, reason: string }} SbomResult
|
|
240
266
|
*/
|
|
@@ -261,17 +287,45 @@ async function generateOneSbom(manifestPath, workspaceOpts) {
|
|
|
261
287
|
*
|
|
262
288
|
* @param {string} root - Resolved workspace root
|
|
263
289
|
* @param {Options} opts
|
|
264
|
-
* @returns {Promise<{ ecosystem: 'javascript' | 'cargo' | 'unknown', manifestPaths: string[] }>}
|
|
290
|
+
* @returns {Promise<{ ecosystem: 'javascript' | 'cargo' | 'maven' | 'gradle' | 'gomodules' | 'pyproject' | 'unknown', manifestPaths: string[] }>}
|
|
265
291
|
* @private
|
|
266
292
|
*/
|
|
267
293
|
async function detectWorkspaceManifests(root, opts) {
|
|
268
294
|
const cargoToml = path.join(root, 'Cargo.toml');
|
|
269
295
|
const cargoLock = path.join(root, 'Cargo.lock');
|
|
270
296
|
const packageJson = path.join(root, 'package.json');
|
|
297
|
+
const pomXml = path.join(root, 'pom.xml');
|
|
271
298
|
if (fs.existsSync(cargoToml) && fs.existsSync(cargoLock)) {
|
|
272
299
|
return { ecosystem: 'cargo', manifestPaths: await discoverWorkspaceCrates(root, opts) };
|
|
273
300
|
}
|
|
274
|
-
|
|
301
|
+
if (fs.existsSync(pomXml)) {
|
|
302
|
+
const manifestPaths = await discoverMavenModules(root, opts);
|
|
303
|
+
if (manifestPaths.length > 0) {
|
|
304
|
+
return { ecosystem: 'maven', manifestPaths };
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
const hasGradleSettings = fs.existsSync(path.join(root, 'settings.gradle'))
|
|
308
|
+
|| fs.existsSync(path.join(root, 'settings.gradle.kts'));
|
|
309
|
+
if (hasGradleSettings) {
|
|
310
|
+
const manifestPaths = await discoverGradleSubprojects(root, opts);
|
|
311
|
+
if (manifestPaths.length > 0) {
|
|
312
|
+
return { ecosystem: 'gradle', manifestPaths };
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
if (fs.existsSync(path.join(root, 'go.work'))) {
|
|
316
|
+
const manifestPaths = await discoverGoWorkspaceModules(root, opts);
|
|
317
|
+
if (manifestPaths.length > 0) {
|
|
318
|
+
return { ecosystem: 'gomodules', manifestPaths };
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
if (fs.existsSync(path.join(root, 'pyproject.toml')) && fs.existsSync(path.join(root, 'uv.lock'))) {
|
|
322
|
+
const manifestPaths = await discoverUvWorkspaceMembers(root, opts);
|
|
323
|
+
if (manifestPaths.length > 0) {
|
|
324
|
+
return { ecosystem: 'pyproject', manifestPaths };
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
const hasJsLock = fs.existsSync(path.join(root, 'bun.lock'))
|
|
328
|
+
|| fs.existsSync(path.join(root, 'pnpm-lock.yaml'))
|
|
275
329
|
|| fs.existsSync(path.join(root, 'yarn.lock'))
|
|
276
330
|
|| fs.existsSync(path.join(root, 'package-lock.json'));
|
|
277
331
|
if (fs.existsSync(packageJson) && hasJsLock) {
|
|
@@ -380,12 +434,45 @@ function batchError(message, wantMetadata, metadata) {
|
|
|
380
434
|
}
|
|
381
435
|
return err;
|
|
382
436
|
}
|
|
437
|
+
/**
|
|
438
|
+
* @overload
|
|
439
|
+
* @param {string} workspaceRoot
|
|
440
|
+
* @param {true} html
|
|
441
|
+
* @param {Options & { batchMetadata: true }} opts
|
|
442
|
+
* @returns {Promise<{ analysis: string, metadata: BatchAnalysisMetadata }>}
|
|
443
|
+
* @throws {Error}
|
|
444
|
+
*/
|
|
445
|
+
/**
|
|
446
|
+
* @overload
|
|
447
|
+
* @param {string} workspaceRoot
|
|
448
|
+
* @param {true} html
|
|
449
|
+
* @param {Options & { batchMetadata?: false }} [opts={}]
|
|
450
|
+
* @returns {Promise<string>}
|
|
451
|
+
* @throws {Error}
|
|
452
|
+
*/
|
|
453
|
+
/**
|
|
454
|
+
* @overload
|
|
455
|
+
* @param {string} workspaceRoot
|
|
456
|
+
* @param {false} html
|
|
457
|
+
* @param {Options & { batchMetadata: true }} opts
|
|
458
|
+
* @returns {Promise<{ analysis: Object.<string, import('@trustify-da/trustify-da-api-model/model/v5/AnalysisReport').AnalysisReport>, metadata: BatchAnalysisMetadata }>}
|
|
459
|
+
* @throws {Error}
|
|
460
|
+
*/
|
|
461
|
+
/**
|
|
462
|
+
* @overload
|
|
463
|
+
* @param {string} workspaceRoot
|
|
464
|
+
* @param {false} html
|
|
465
|
+
* @param {Options & { batchMetadata?: false }} [opts={}]
|
|
466
|
+
* @returns {Promise<Object.<string, import('@trustify-da/trustify-da-api-model/model/v5/AnalysisReport').AnalysisReport>>}
|
|
467
|
+
* @throws {Error}
|
|
468
|
+
*/
|
|
383
469
|
/**
|
|
384
470
|
* Get stack analysis for all workspace packages/crates (batch).
|
|
385
471
|
* Detects ecosystem from workspace root: Cargo (Cargo.toml + Cargo.lock) or JS/TS (package.json + lock file).
|
|
386
472
|
* SBOMs are generated in parallel (see `batchConcurrency`) unless `continueOnError: false` (fail-fast sequential).
|
|
387
473
|
* With `opts.batchMetadata` / `TRUSTIFY_DA_BATCH_METADATA`, returns `{ analysis, metadata }` including validation and SBOM errors.
|
|
388
474
|
*
|
|
475
|
+
* @overload
|
|
389
476
|
* @param {string} workspaceRoot - Path to workspace root (containing lock file and workspace config)
|
|
390
477
|
* @param {boolean} [html=false] - true returns HTML, false returns JSON report
|
|
391
478
|
* @param {Options} [opts={}] - `batchConcurrency`, discovery ignores, `continueOnError` (default true), `batchMetadata` (default false)
|
|
@@ -416,7 +503,7 @@ async function stackAnalysisBatch(workspaceRoot, html = false, opts = {}) {
|
|
|
416
503
|
}
|
|
417
504
|
}
|
|
418
505
|
if (manifestPaths.length === 0) {
|
|
419
|
-
throw new Error(`No workspace manifests found at ${root}. Ensure Cargo.toml+Cargo.lock or package.json+lock file
|
|
506
|
+
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).`);
|
|
420
507
|
}
|
|
421
508
|
const workspaceOpts = { ...opts, TRUSTIFY_DA_WORKSPACE_DIR: root };
|
|
422
509
|
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';
|
|
@@ -135,7 +135,7 @@ function execSyft(imageRef, opts = {}) {
|
|
|
135
135
|
function getSyftEnvs(dockerPath, podmanPath) {
|
|
136
136
|
let path = null;
|
|
137
137
|
if (dockerPath && podmanPath) {
|
|
138
|
-
path = `${dockerPath}${
|
|
138
|
+
path = `${dockerPath}${delimiter}${podmanPath}`;
|
|
139
139
|
}
|
|
140
140
|
else if (dockerPath) {
|
|
141
141
|
path = dockerPath;
|
|
@@ -276,7 +276,16 @@ function podmanGetVariant(opts = {}) {
|
|
|
276
276
|
* @returns {string} - The information
|
|
277
277
|
*/
|
|
278
278
|
function dockerPodmanInfo(dockerSupplier, podmanSupplier, opts = {}) {
|
|
279
|
-
|
|
279
|
+
try {
|
|
280
|
+
const result = dockerSupplier(opts);
|
|
281
|
+
if (result) {
|
|
282
|
+
return result;
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
catch (_) {
|
|
286
|
+
// docker not available, fall through to podman
|
|
287
|
+
}
|
|
288
|
+
return podmanSupplier(opts);
|
|
280
289
|
}
|
|
281
290
|
/**
|
|
282
291
|
* Gets the digests for an image
|
package/dist/src/provider.d.ts
CHANGED
|
@@ -21,7 +21,7 @@ export function match(manifest: string, providers: [Provider], opts?: {
|
|
|
21
21
|
TRUSTIFY_DA_WORKSPACE_DIR?: string;
|
|
22
22
|
}): Provider;
|
|
23
23
|
/** @typedef {{ecosystem: string, contentType: string, content: string}} Provided */
|
|
24
|
-
/** @typedef {{isSupported: function(string): boolean, validateLockFile: function(string, Object): void, provideComponent: function(string, {}): Provided | Promise<Provided>, provideStack: function(string, {}): Provided | Promise<Provided>, readLicenseFromManifest: function(string): string | null}} Provider */
|
|
24
|
+
/** @typedef {{isSupported: function(string): boolean, validateLockFile: function(string, Object): void, provideComponent: function(string, {}): Provided | Promise<Provided>, provideStack: function(string, {}): Provided | Promise<Provided>, readLicenseFromManifest: function(string, Object=): string | null, packageManagerName: function(): string}} Provider */
|
|
25
25
|
/**
|
|
26
26
|
* MUST include all providers here.
|
|
27
27
|
* @type {[Provider]}
|
|
@@ -34,8 +34,9 @@ export type Provided = {
|
|
|
34
34
|
};
|
|
35
35
|
export type Provider = {
|
|
36
36
|
isSupported: (arg0: string) => boolean;
|
|
37
|
-
validateLockFile: (arg0: string, arg1:
|
|
37
|
+
validateLockFile: (arg0: string, arg1: Object) => void;
|
|
38
38
|
provideComponent: (arg0: string, arg1: {}) => Provided | Promise<Provided>;
|
|
39
39
|
provideStack: (arg0: string, arg1: {}) => Provided | Promise<Provided>;
|
|
40
|
-
readLicenseFromManifest: (arg0: string) => string | null;
|
|
40
|
+
readLicenseFromManifest: (arg0: string, arg1: Object | undefined) => string | null;
|
|
41
|
+
packageManagerName: () => string;
|
|
41
42
|
};
|