@trustify-da/trustify-da-javascript-client 0.3.0-ea.e660b02 → 0.3.0-ea.f041aa6
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/dist/package.json +18 -19
- package/dist/src/analysis.d.ts +7 -7
- package/dist/src/index.d.ts +9 -9
- 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/utils.d.ts +5 -5
- package/dist/src/provider.d.ts +2 -2
- package/dist/src/providers/base_java.d.ts +2 -2
- package/dist/src/providers/base_javascript.d.ts +9 -9
- package/dist/src/providers/base_pyproject.d.ts +5 -5
- package/dist/src/providers/golang_gomodules.d.ts +1 -1
- 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 +2 -2
- package/dist/src/providers/javascript_npm.d.ts +6 -1
- package/dist/src/providers/processors/yarn_berry_processor.d.ts +2 -2
- package/dist/src/providers/processors/yarn_classic_processor.d.ts +2 -2
- package/dist/src/providers/python_poetry.d.ts +1 -1
- package/dist/src/providers/python_uv.d.ts +1 -1
- package/dist/src/providers/rust_cargo.d.ts +1 -1
- package/dist/src/tools.d.ts +2 -2
- package/package.json +19 -20
package/dist/package.json
CHANGED
|
@@ -35,8 +35,8 @@
|
|
|
35
35
|
"config/**/*"
|
|
36
36
|
],
|
|
37
37
|
"scripts": {
|
|
38
|
-
"lint": "eslint src test
|
|
39
|
-
"lint:fix": "eslint src test --
|
|
38
|
+
"lint": "eslint src test",
|
|
39
|
+
"lint:fix": "eslint src test --fix",
|
|
40
40
|
"test": "c8 npm run tests",
|
|
41
41
|
"tests": "mocha --config .mocharc.json",
|
|
42
42
|
"tests:rep": "mocha --reporter-option maxDiffSize=0 --reporter json > unit-tests-result.json",
|
|
@@ -48,17 +48,17 @@
|
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
50
|
"@babel/core": "^7.23.2",
|
|
51
|
-
"@cyclonedx/cyclonedx-library": "^
|
|
51
|
+
"@cyclonedx/cyclonedx-library": "^10.0.0",
|
|
52
52
|
"eslint-import-resolver-typescript": "^4.4.4",
|
|
53
53
|
"fast-glob": "^3.3.3",
|
|
54
54
|
"fast-xml-parser": "^5.3.4",
|
|
55
55
|
"help": "^3.0.2",
|
|
56
|
-
"https-proxy-agent": "^
|
|
56
|
+
"https-proxy-agent": "^9.0.0",
|
|
57
57
|
"js-yaml": "^4.1.1",
|
|
58
58
|
"jsonc-parser": "^3.3.1",
|
|
59
59
|
"micromatch": "^4.0.8",
|
|
60
60
|
"node-fetch": "^3.3.2",
|
|
61
|
-
"p-limit": "^
|
|
61
|
+
"p-limit": "^7.3.0",
|
|
62
62
|
"packageurl-js": "~1.0.2",
|
|
63
63
|
"smol-toml": "^1.6.0",
|
|
64
64
|
"tree-sitter-gomod": "github:strum355/tree-sitter-go-mod#56326f2ad478892ace58ff247a97d492a3cbcdda",
|
|
@@ -68,23 +68,24 @@
|
|
|
68
68
|
},
|
|
69
69
|
"devDependencies": {
|
|
70
70
|
"@babel/core": "^7.23.2",
|
|
71
|
-
"@trustify-da/trustify-da-api-model": "^2.0.
|
|
72
|
-
"@types/node": "^
|
|
71
|
+
"@trustify-da/trustify-da-api-model": "^2.0.9",
|
|
72
|
+
"@types/node": "^25.9.1",
|
|
73
73
|
"@types/which": "^3.0.4",
|
|
74
74
|
"babel-plugin-rewire": "^1.2.0",
|
|
75
75
|
"c8": "^11.0.0",
|
|
76
|
-
"chai": "^
|
|
77
|
-
"eslint": "^
|
|
76
|
+
"chai": "^6.2.2",
|
|
77
|
+
"@eslint/js": "^10.0.0",
|
|
78
|
+
"eslint": "^10.4.1",
|
|
78
79
|
"eslint-import-resolver-typescript": "^4.4.4",
|
|
79
|
-
"eslint-plugin-
|
|
80
|
-
"
|
|
80
|
+
"eslint-plugin-import-x": "^4.16.2",
|
|
81
|
+
"globals": "^17.6.0",
|
|
81
82
|
"esmock": "^2.6.2",
|
|
82
|
-
"mocha": "^
|
|
83
|
+
"mocha": "^11.7.6",
|
|
83
84
|
"msw": "^2.12.7",
|
|
84
|
-
"sinon": "^
|
|
85
|
-
"sinon-chai": "^
|
|
86
|
-
"typescript": "^
|
|
87
|
-
"which": "^
|
|
85
|
+
"sinon": "^22.0.0",
|
|
86
|
+
"sinon-chai": "^4.0.1",
|
|
87
|
+
"typescript": "^6.0.3",
|
|
88
|
+
"which": "^7.0.0"
|
|
88
89
|
},
|
|
89
90
|
"mocha": {
|
|
90
91
|
"check-leaks": false,
|
|
@@ -112,12 +113,10 @@
|
|
|
112
113
|
"reporter": [
|
|
113
114
|
"html",
|
|
114
115
|
"json",
|
|
116
|
+
"lcov",
|
|
115
117
|
"text"
|
|
116
118
|
]
|
|
117
119
|
},
|
|
118
|
-
"eslintIgnore": [
|
|
119
|
-
"index.js"
|
|
120
|
-
],
|
|
121
120
|
"resolutions": {
|
|
122
121
|
"@hapi/joi": "17.1.1"
|
|
123
122
|
}
|
package/dist/src/analysis.d.ts
CHANGED
|
@@ -16,7 +16,7 @@ export default _default;
|
|
|
16
16
|
* @param {import("index.js").Options} [opts={}] - optional various options to pass along the application
|
|
17
17
|
* @returns {Promise<import('@trustify-da/trustify-da-api-model/model/v5/AnalysisReport').AnalysisReport>}
|
|
18
18
|
*/
|
|
19
|
-
declare function requestComponent(provider:
|
|
19
|
+
declare function requestComponent(provider: any, manifest: string, url: string, opts?: any): Promise<any>;
|
|
20
20
|
/**
|
|
21
21
|
* Send a stack analysis request and get the report as 'text/html' or 'application/json'.
|
|
22
22
|
* @param {import('./provider').Provider} provider - the provided data for constructing the request
|
|
@@ -26,7 +26,7 @@ declare function requestComponent(provider: import("./provider").Provider, manif
|
|
|
26
26
|
* @param {import("index.js").Options} [opts={}] - optional various options to pass along the application
|
|
27
27
|
* @returns {Promise<string|import('@trustify-da/trustify-da-api-model/model/v5/AnalysisReport').AnalysisReport>}
|
|
28
28
|
*/
|
|
29
|
-
declare function requestStack(provider:
|
|
29
|
+
declare function requestStack(provider: any, manifest: string, url: string, html?: boolean, opts?: any): Promise<string | any>;
|
|
30
30
|
/**
|
|
31
31
|
* Send a batch stack analysis request for multiple manifests (SBOMs keyed by purl).
|
|
32
32
|
* @param {Object.<string, object>} sbomByPurl - Map of root purl to CycloneDX SBOM object
|
|
@@ -36,9 +36,9 @@ declare function requestStack(provider: import("./provider").Provider, manifest:
|
|
|
36
36
|
* @returns {Promise<string|Object.<string, import('@trustify-da/trustify-da-api-model/model/v5/AnalysisReport').AnalysisReport>>}
|
|
37
37
|
*/
|
|
38
38
|
declare function requestStackBatch(sbomByPurl: {
|
|
39
|
+
[x: string]: object;
|
|
40
|
+
}, url: string, html?: boolean, opts?: any): Promise<string | {
|
|
39
41
|
[x: string]: any;
|
|
40
|
-
}, url: string, html?: boolean, opts?: import("index.js").Options): Promise<string | {
|
|
41
|
-
[x: string]: import("@trustify-da/trustify-da-api-model/model/v5/AnalysisReport").AnalysisReport;
|
|
42
42
|
}>;
|
|
43
43
|
/**
|
|
44
44
|
*
|
|
@@ -47,8 +47,8 @@ declare function requestStackBatch(sbomByPurl: {
|
|
|
47
47
|
* @param {import("index.js").Options} [opts={}] - optional various options to pass along the application
|
|
48
48
|
* @returns {Promise<string|Object.<string, import('@trustify-da/trustify-da-api-model/model/v5/AnalysisReport').AnalysisReport>>}
|
|
49
49
|
*/
|
|
50
|
-
declare function requestImages(imageRefs: Array<string>, url: string, html?: boolean, opts?:
|
|
51
|
-
[x: string]:
|
|
50
|
+
declare function requestImages(imageRefs: Array<string>, url: string, html?: boolean, opts?: any): Promise<string | {
|
|
51
|
+
[x: string]: any;
|
|
52
52
|
}>;
|
|
53
53
|
/**
|
|
54
54
|
*
|
|
@@ -56,4 +56,4 @@ declare function requestImages(imageRefs: Array<string>, url: string, html?: boo
|
|
|
56
56
|
* @param {import("index.js").Options} [opts={}] - optional various options to pass headers for t he validateToken Request
|
|
57
57
|
* @return {Promise<number>} return the HTTP status Code of the response from the validate token request.
|
|
58
58
|
*/
|
|
59
|
-
declare function validateToken(url: any, opts?:
|
|
59
|
+
declare function validateToken(url: any, opts?: any): Promise<number>;
|
package/dist/src/index.d.ts
CHANGED
|
@@ -106,7 +106,7 @@ export type SbomResult = {
|
|
|
106
106
|
* @returns {Promise<import('@trustify-da/trustify-da-api-model/model/v5/AnalysisReport').AnalysisReport>}
|
|
107
107
|
* @throws {Error} if no matching provider, failed to get create content, or backend request failed
|
|
108
108
|
*/
|
|
109
|
-
declare function componentAnalysis(manifest: string, opts?: Options): Promise<
|
|
109
|
+
declare function componentAnalysis(manifest: string, opts?: Options): Promise<any>;
|
|
110
110
|
/**
|
|
111
111
|
* @overload
|
|
112
112
|
* @param {string} manifest
|
|
@@ -124,7 +124,7 @@ declare function stackAnalysis(manifest: string, html: true, opts?: Options | un
|
|
|
124
124
|
* @returns {Promise<import('@trustify-da/trustify-da-api-model/model/v5/AnalysisReport').AnalysisReport>}
|
|
125
125
|
* @throws {Error}
|
|
126
126
|
*/
|
|
127
|
-
declare function stackAnalysis(manifest: string, html: false, opts?: Options | undefined): Promise<
|
|
127
|
+
declare function stackAnalysis(manifest: string, html: false, opts?: Options | undefined): Promise<any>;
|
|
128
128
|
/**
|
|
129
129
|
* Get stack analysis report for a manifest file.
|
|
130
130
|
* @overload
|
|
@@ -135,7 +135,7 @@ declare function stackAnalysis(manifest: string, html: false, opts?: Options | u
|
|
|
135
135
|
* @throws {Error} if manifest inaccessible, no matching provider, failed to get create content,
|
|
136
136
|
* or backend request failed
|
|
137
137
|
*/
|
|
138
|
-
declare function stackAnalysis(manifest: string, html?: boolean | undefined, opts?: Options | undefined): Promise<string |
|
|
138
|
+
declare function stackAnalysis(manifest: string, html?: boolean | undefined, opts?: Options | undefined): Promise<string | any>;
|
|
139
139
|
/**
|
|
140
140
|
* @overload
|
|
141
141
|
* @param {string} workspaceRoot
|
|
@@ -173,7 +173,7 @@ declare function stackAnalysisBatch(workspaceRoot: string, html: false, opts: Op
|
|
|
173
173
|
batchMetadata: true;
|
|
174
174
|
}): Promise<{
|
|
175
175
|
analysis: {
|
|
176
|
-
[x: string]:
|
|
176
|
+
[x: string]: any;
|
|
177
177
|
};
|
|
178
178
|
metadata: BatchAnalysisMetadata;
|
|
179
179
|
}>;
|
|
@@ -188,7 +188,7 @@ declare function stackAnalysisBatch(workspaceRoot: string, html: false, opts: Op
|
|
|
188
188
|
declare function stackAnalysisBatch(workspaceRoot: string, html: false, opts?: (Options & {
|
|
189
189
|
batchMetadata?: false;
|
|
190
190
|
}) | undefined): Promise<{
|
|
191
|
-
[x: string]:
|
|
191
|
+
[x: string]: any;
|
|
192
192
|
}>;
|
|
193
193
|
/**
|
|
194
194
|
* Get stack analysis for all workspace packages/crates (batch).
|
|
@@ -204,10 +204,10 @@ declare function stackAnalysisBatch(workspaceRoot: string, html: false, opts?: (
|
|
|
204
204
|
* @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.
|
|
205
205
|
*/
|
|
206
206
|
declare function stackAnalysisBatch(workspaceRoot: string, html?: boolean | undefined, opts?: Options | undefined): Promise<string | {
|
|
207
|
-
[x: string]:
|
|
207
|
+
[x: string]: any;
|
|
208
208
|
} | {
|
|
209
209
|
analysis: string | {
|
|
210
|
-
[x: string]:
|
|
210
|
+
[x: string]: any;
|
|
211
211
|
};
|
|
212
212
|
metadata: BatchAnalysisMetadata;
|
|
213
213
|
}>;
|
|
@@ -229,7 +229,7 @@ declare function imageAnalysis(imageRefs: Array<string>, html: true, opts?: Opti
|
|
|
229
229
|
* @throws {Error}
|
|
230
230
|
*/
|
|
231
231
|
declare function imageAnalysis(imageRefs: Array<string>, html: false, opts?: Options | undefined): Promise<{
|
|
232
|
-
[x: string]:
|
|
232
|
+
[x: string]: any;
|
|
233
233
|
}>;
|
|
234
234
|
/**
|
|
235
235
|
* Get image analysis report for a set of OCI image references.
|
|
@@ -242,7 +242,7 @@ declare function imageAnalysis(imageRefs: Array<string>, html: false, opts?: Opt
|
|
|
242
242
|
* or backend request failed
|
|
243
243
|
*/
|
|
244
244
|
declare function imageAnalysis(imageRefs: Array<string>, html?: boolean | undefined, opts?: Options | undefined): Promise<string | {
|
|
245
|
-
[x: string]:
|
|
245
|
+
[x: string]: any;
|
|
246
246
|
}>;
|
|
247
247
|
/**
|
|
248
248
|
* Validates the Exhort token.
|
|
@@ -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} */
|
|
@@ -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';
|
package/dist/src/provider.d.ts
CHANGED
|
@@ -34,9 +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, arg1:
|
|
40
|
+
readLicenseFromManifest: (arg0: string, arg1: Object | undefined) => string | null;
|
|
41
41
|
packageManagerName: () => string;
|
|
42
42
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type ecosystem_maven =
|
|
1
|
+
export type ecosystem_maven = any;
|
|
2
2
|
/** @typedef {import('../provider').Provider} */
|
|
3
3
|
/** @typedef {import('../provider').Provided} Provided */
|
|
4
4
|
/** @typedef {{name: string, version: string}} Package */
|
|
@@ -70,7 +70,7 @@ export default class Base_Java {
|
|
|
70
70
|
*/
|
|
71
71
|
selectToolBinary(manifestPath: string, opts: {}): string | null;
|
|
72
72
|
}
|
|
73
|
-
export type Provided =
|
|
73
|
+
export type Provided = any;
|
|
74
74
|
export type Package = {
|
|
75
75
|
name: string;
|
|
76
76
|
version: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type purlType =
|
|
1
|
+
export type purlType = any;
|
|
2
2
|
/** @typedef {import('../provider').Provider} */
|
|
3
3
|
/** @typedef {import('../provider').Provided} Provided */
|
|
4
4
|
/**
|
|
@@ -19,7 +19,7 @@ export default class Base_javascript {
|
|
|
19
19
|
* @param {Object} opts - Configuration options for the provider
|
|
20
20
|
* @protected
|
|
21
21
|
*/
|
|
22
|
-
protected _setUp(manifestPath: string, opts:
|
|
22
|
+
protected _setUp(manifestPath: string, opts: Object): void;
|
|
23
23
|
/**
|
|
24
24
|
* Gets the current manifest object
|
|
25
25
|
* @returns {Manifest} The manifest object
|
|
@@ -91,21 +91,21 @@ export default class Base_javascript {
|
|
|
91
91
|
* @param {Object} [opts={}] - optional; may contain TRUSTIFY_DA_WORKSPACE_DIR
|
|
92
92
|
* @returns {boolean} True if the lock file exists
|
|
93
93
|
*/
|
|
94
|
-
validateLockFile(manifestDir: string, opts?:
|
|
94
|
+
validateLockFile(manifestDir: string, opts?: Object): boolean;
|
|
95
95
|
/**
|
|
96
96
|
* Provides content and content type for stack analysis
|
|
97
97
|
* @param {string} manifestPath - The manifest path or name
|
|
98
98
|
* @param {Object} [opts={}] - Optional configuration options
|
|
99
99
|
* @returns {Provided} The provided data for stack analysis
|
|
100
100
|
*/
|
|
101
|
-
provideStack(manifestPath: string, opts?:
|
|
101
|
+
provideStack(manifestPath: string, opts?: Object): Provided;
|
|
102
102
|
/**
|
|
103
103
|
* Provides content and content type for component analysis
|
|
104
104
|
* @param {string} manifestPath - Path to package.json for component report
|
|
105
105
|
* @param {Object} [opts={}] - Optional configuration options
|
|
106
106
|
* @returns {Provided} The provided data for component analysis
|
|
107
107
|
*/
|
|
108
|
-
provideComponent(manifestPath: string, opts?:
|
|
108
|
+
provideComponent(manifestPath: string, opts?: Object): Provided;
|
|
109
109
|
/**
|
|
110
110
|
* Read license from manifest (package.json). Reused by npm, pnpm, yarn.
|
|
111
111
|
* @param {string} manifestPath - path to package.json
|
|
@@ -119,21 +119,21 @@ export default class Base_javascript {
|
|
|
119
119
|
* @returns {Object} The dependency tree
|
|
120
120
|
* @protected
|
|
121
121
|
*/
|
|
122
|
-
protected _buildDependencyTree(includeTransitive: boolean, opts?:
|
|
122
|
+
protected _buildDependencyTree(includeTransitive: boolean, opts?: Object): Object;
|
|
123
123
|
/**
|
|
124
124
|
* Recursively builds the Sbom from the JSON that npm listing returns
|
|
125
125
|
* @param {Sbom} sbom - The SBOM object to add dependencies to
|
|
126
126
|
* @param {Object} depTree - The current dependency tree
|
|
127
127
|
* @protected
|
|
128
128
|
*/
|
|
129
|
-
protected _addDependenciesToSbom(sbom: Sbom, depTree:
|
|
129
|
+
protected _addDependenciesToSbom(sbom: Sbom, depTree: Object): void;
|
|
130
130
|
/**
|
|
131
131
|
* Extracts root dependencies from the dependency tree
|
|
132
132
|
* @param {Object} depTree - The dependency tree object
|
|
133
133
|
* @returns {Map<string, PackageURL>} Map of dependency names to their PackageURL objects
|
|
134
134
|
* @protected
|
|
135
135
|
*/
|
|
136
|
-
protected _getRootDependencies(depTree:
|
|
136
|
+
protected _getRootDependencies(depTree: Object): Map<string, PackageURL>;
|
|
137
137
|
/**
|
|
138
138
|
* Gets the version of the package manager
|
|
139
139
|
* @returns {string} The version string of the package manager
|
|
@@ -155,6 +155,6 @@ export default class Base_javascript {
|
|
|
155
155
|
protected _parseDepTreeOutput(output: string): string;
|
|
156
156
|
#private;
|
|
157
157
|
}
|
|
158
|
-
export type Provided =
|
|
158
|
+
export type Provided = any;
|
|
159
159
|
import Manifest from './manifest.js';
|
|
160
160
|
import Sbom from '../sbom.js';
|
|
@@ -13,7 +13,7 @@ export default class Base_pyproject {
|
|
|
13
13
|
* @param {Object} [opts={}]
|
|
14
14
|
* @returns {boolean}
|
|
15
15
|
*/
|
|
16
|
-
validateLockFile(manifestDir: string, opts?:
|
|
16
|
+
validateLockFile(manifestDir: string, opts?: Object): boolean;
|
|
17
17
|
/**
|
|
18
18
|
* Walk up from manifestDir to find the directory containing the lock file.
|
|
19
19
|
* Follows the same pattern as Base_javascript._findLockFileDir().
|
|
@@ -22,7 +22,7 @@ export default class Base_pyproject {
|
|
|
22
22
|
* @returns {string|null}
|
|
23
23
|
* @protected
|
|
24
24
|
*/
|
|
25
|
-
protected _findLockFileDir(manifestDir: string, opts?:
|
|
25
|
+
protected _findLockFileDir(manifestDir: string, opts?: Object): string | null;
|
|
26
26
|
/**
|
|
27
27
|
* Detect workspace root boundaries.
|
|
28
28
|
* Currently only uv has native workspace support ([tool.uv.workspace] in pyproject.toml).
|
|
@@ -44,13 +44,13 @@ export default class Base_pyproject {
|
|
|
44
44
|
* @param {Object} [opts={}]
|
|
45
45
|
* @returns {Promise<Provided>}
|
|
46
46
|
*/
|
|
47
|
-
provideStack(manifest: string, opts?:
|
|
47
|
+
provideStack(manifest: string, opts?: Object): Promise<Provided>;
|
|
48
48
|
/**
|
|
49
49
|
* @param {string} manifest - path to pyproject.toml
|
|
50
50
|
* @param {Object} [opts={}]
|
|
51
51
|
* @returns {Promise<Provided>}
|
|
52
52
|
*/
|
|
53
|
-
provideComponent(manifest: string, opts?:
|
|
53
|
+
provideComponent(manifest: string, opts?: Object): Promise<Provided>;
|
|
54
54
|
/**
|
|
55
55
|
* @returns {string}
|
|
56
56
|
* @protected
|
|
@@ -77,7 +77,7 @@ export default class Base_pyproject {
|
|
|
77
77
|
* @returns {Promise<DependencyData>}
|
|
78
78
|
* @protected
|
|
79
79
|
*/
|
|
80
|
-
protected _getDependencyData(manifestDir: string, workspaceDir: string, parsed: object, opts:
|
|
80
|
+
protected _getDependencyData(manifestDir: string, workspaceDir: string, parsed: object, opts: Object): Promise<DependencyData>;
|
|
81
81
|
/**
|
|
82
82
|
* Canonicalize a Python package name per PEP 503.
|
|
83
83
|
* @param {string} name
|
|
@@ -16,7 +16,7 @@ declare namespace _default {
|
|
|
16
16
|
export function packageManagerName(): string;
|
|
17
17
|
}
|
|
18
18
|
export default _default;
|
|
19
|
-
export type Provided =
|
|
19
|
+
export type Provided = any;
|
|
20
20
|
export type Package = {
|
|
21
21
|
name: string;
|
|
22
22
|
version: string;
|
|
@@ -3,5 +3,5 @@ export default class Java_gradle_groovy extends Java_gradle {
|
|
|
3
3
|
_parseAliasForLibsNotation(alias: any): any;
|
|
4
4
|
_extractDepToBeIgnored(dep: any): any;
|
|
5
5
|
}
|
|
6
|
-
export type Provided =
|
|
6
|
+
export type Provided = any;
|
|
7
7
|
import Java_gradle from './java_gradle.js';
|
|
@@ -7,5 +7,5 @@ export default class Java_gradle_kotlin extends Java_gradle {
|
|
|
7
7
|
_parseAliasForLibsNotation(alias: any): any;
|
|
8
8
|
_extractDepToBeIgnored(dep: any): string | null;
|
|
9
9
|
}
|
|
10
|
-
export type Provided =
|
|
10
|
+
export type Provided = any;
|
|
11
11
|
import Java_gradle from './java_gradle.js';
|
|
@@ -51,8 +51,8 @@ export default class Java_maven extends Base_java {
|
|
|
51
51
|
createSbomFileFromTextFormat(textGraphList: string, ignoredDeps: [string], opts: any, manifestPath: string): string;
|
|
52
52
|
#private;
|
|
53
53
|
}
|
|
54
|
-
export type Java_maven =
|
|
55
|
-
export type Provided =
|
|
54
|
+
export type Java_maven = any;
|
|
55
|
+
export type Provided = any;
|
|
56
56
|
export type Package = {
|
|
57
57
|
name: string;
|
|
58
58
|
version: string;
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
export default class Javascript_npm extends Base_javascript {
|
|
2
2
|
_listCmdArgs(includeTransitive: any): string[];
|
|
3
|
-
_buildDependencyTree(includeTransitive: any, opts?: {}):
|
|
3
|
+
_buildDependencyTree(includeTransitive: any, opts?: {}): Object | {
|
|
4
|
+
name: any;
|
|
5
|
+
version: any;
|
|
6
|
+
dependencies: any;
|
|
7
|
+
optionalDependencies: any;
|
|
8
|
+
};
|
|
4
9
|
}
|
|
5
10
|
import Base_javascript from './base_javascript.js';
|
|
@@ -29,13 +29,13 @@ export default class Yarn_berry_processor extends Yarn_processor {
|
|
|
29
29
|
* @param {Object} depTree - The dependency tree object
|
|
30
30
|
* @returns {Map<string, PackageURL>} Map of dependency names to their PackageURL objects
|
|
31
31
|
*/
|
|
32
|
-
getRootDependencies(depTree:
|
|
32
|
+
getRootDependencies(depTree: Object): Map<string, PackageURL>;
|
|
33
33
|
/**
|
|
34
34
|
* Adds dependencies to the SBOM
|
|
35
35
|
* @param {Sbom} sbom - The SBOM object to add dependencies to
|
|
36
36
|
* @param {Object} depTree - The dependency tree object
|
|
37
37
|
*/
|
|
38
|
-
addDependenciesToSbom(sbom: Sbom, depTree:
|
|
38
|
+
addDependenciesToSbom(sbom: Sbom, depTree: Object): void;
|
|
39
39
|
#private;
|
|
40
40
|
}
|
|
41
41
|
import Yarn_processor from "./yarn_processor.js";
|
|
@@ -25,13 +25,13 @@ export default class Yarn_classic_processor extends Yarn_processor {
|
|
|
25
25
|
* @param {Object} depTree - The dependency tree object
|
|
26
26
|
* @returns {Map<string, PackageURL>} Map of dependency names to their PackageURL objects
|
|
27
27
|
*/
|
|
28
|
-
getRootDependencies(depTree:
|
|
28
|
+
getRootDependencies(depTree: Object): Map<string, PackageURL>;
|
|
29
29
|
/**
|
|
30
30
|
* Adds dependencies to the SBOM
|
|
31
31
|
* @param {Sbom} sbom - The SBOM object to add dependencies to
|
|
32
32
|
* @param {Object} depTree - The dependency tree object
|
|
33
33
|
*/
|
|
34
|
-
addDependenciesToSbom(sbom: Sbom, depTree:
|
|
34
|
+
addDependenciesToSbom(sbom: Sbom, depTree: Object): void;
|
|
35
35
|
#private;
|
|
36
36
|
}
|
|
37
37
|
import Yarn_processor from "./yarn_processor.js";
|
|
@@ -7,7 +7,7 @@ export default class Python_poetry extends Base_pyproject {
|
|
|
7
7
|
* @param {Object} opts
|
|
8
8
|
* @returns {Promise<{directDeps: string[], graph: Map<string, {name: string, version: string, children: string[]}>}>}
|
|
9
9
|
*/
|
|
10
|
-
_getDependencyData(manifestDir: string, _workspaceDir: string, parsed: object, opts:
|
|
10
|
+
_getDependencyData(manifestDir: string, _workspaceDir: string, parsed: object, opts: Object): Promise<{
|
|
11
11
|
directDeps: string[];
|
|
12
12
|
graph: Map<string, {
|
|
13
13
|
name: string;
|
|
@@ -24,7 +24,7 @@ export default class Python_uv extends Base_pyproject {
|
|
|
24
24
|
* @param {Object} opts
|
|
25
25
|
* @returns {string}
|
|
26
26
|
*/
|
|
27
|
-
_getUvExportOutput(manifestDir: string, opts:
|
|
27
|
+
_getUvExportOutput(manifestDir: string, opts: Object): string;
|
|
28
28
|
/**
|
|
29
29
|
* Parse uv export output into a dependency graph using tree-sitter-requirements
|
|
30
30
|
* for package/version extraction and string parsing for "# via" comments.
|
|
@@ -7,7 +7,7 @@ declare namespace _default {
|
|
|
7
7
|
export function packageManagerName(): string;
|
|
8
8
|
}
|
|
9
9
|
export default _default;
|
|
10
|
-
export type Provided =
|
|
10
|
+
export type Provided = any;
|
|
11
11
|
/**
|
|
12
12
|
* @param {string} manifestName - the subject manifest name-type
|
|
13
13
|
* @returns {boolean} - return true if `Cargo.toml` is the manifest name-type
|
package/dist/src/tools.d.ts
CHANGED
|
@@ -100,13 +100,13 @@ export function invokeCommand(bin: string, args: Array<string>, opts?: import("c
|
|
|
100
100
|
* @param {import("index.js").Options} opts - The trustify DA options that may contain proxy configuration
|
|
101
101
|
* @returns {RequestInit} The fetch options with proxy agent if applicable
|
|
102
102
|
*/
|
|
103
|
-
export function addProxyAgent(options: RequestInit, opts:
|
|
103
|
+
export function addProxyAgent(options: RequestInit, opts: any): RequestInit;
|
|
104
104
|
/**
|
|
105
105
|
* Utility function for fetching vendor tokens
|
|
106
106
|
* @param {import("index.js").Options} [opts={}] - optional various options to pass along the application
|
|
107
107
|
* @returns {{}}
|
|
108
108
|
*/
|
|
109
|
-
export function getTokenHeaders(opts?:
|
|
109
|
+
export function getTokenHeaders(opts?: any): {};
|
|
110
110
|
export const RegexNotToBeLogged: RegExp;
|
|
111
111
|
export const TRUSTIFY_DA_TOKEN_HEADER: "trust-da-token";
|
|
112
112
|
export const TRUSTIFY_DA_TELEMETRY_ID_HEADER: "telemetry-anonymous-id";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trustify-da/trustify-da-javascript-client",
|
|
3
|
-
"version": "0.3.0-ea.
|
|
3
|
+
"version": "0.3.0-ea.f041aa6",
|
|
4
4
|
"description": "Code-Ready Dependency Analytics JavaScript API.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"homepage": "https://github.com/guacsec/trustify-da-javascript-client#README.md",
|
|
@@ -35,8 +35,8 @@
|
|
|
35
35
|
"config/**/*"
|
|
36
36
|
],
|
|
37
37
|
"scripts": {
|
|
38
|
-
"lint": "eslint src test
|
|
39
|
-
"lint:fix": "eslint src test --
|
|
38
|
+
"lint": "eslint src test",
|
|
39
|
+
"lint:fix": "eslint src test --fix",
|
|
40
40
|
"test": "c8 npm run tests",
|
|
41
41
|
"tests": "mocha --config .mocharc.json",
|
|
42
42
|
"tests:rep": "mocha --reporter-option maxDiffSize=0 --reporter json > unit-tests-result.json",
|
|
@@ -48,17 +48,17 @@
|
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
50
|
"@babel/core": "^7.23.2",
|
|
51
|
-
"@cyclonedx/cyclonedx-library": "^
|
|
51
|
+
"@cyclonedx/cyclonedx-library": "^10.0.0",
|
|
52
52
|
"eslint-import-resolver-typescript": "^4.4.4",
|
|
53
53
|
"fast-glob": "^3.3.3",
|
|
54
54
|
"fast-xml-parser": "^5.3.4",
|
|
55
55
|
"help": "^3.0.2",
|
|
56
|
-
"https-proxy-agent": "^
|
|
56
|
+
"https-proxy-agent": "^9.0.0",
|
|
57
57
|
"js-yaml": "^4.1.1",
|
|
58
58
|
"jsonc-parser": "^3.3.1",
|
|
59
59
|
"micromatch": "^4.0.8",
|
|
60
60
|
"node-fetch": "^3.3.2",
|
|
61
|
-
"p-limit": "^
|
|
61
|
+
"p-limit": "^7.3.0",
|
|
62
62
|
"packageurl-js": "~1.0.2",
|
|
63
63
|
"smol-toml": "^1.6.0",
|
|
64
64
|
"tree-sitter-gomod": "github:strum355/tree-sitter-go-mod#56326f2ad478892ace58ff247a97d492a3cbcdda",
|
|
@@ -68,23 +68,24 @@
|
|
|
68
68
|
},
|
|
69
69
|
"devDependencies": {
|
|
70
70
|
"@babel/core": "^7.23.2",
|
|
71
|
-
"@trustify-da/trustify-da-api-model": "^2.0.
|
|
72
|
-
"@types/node": "^
|
|
71
|
+
"@trustify-da/trustify-da-api-model": "^2.0.9",
|
|
72
|
+
"@types/node": "^25.9.1",
|
|
73
73
|
"@types/which": "^3.0.4",
|
|
74
74
|
"babel-plugin-rewire": "^1.2.0",
|
|
75
75
|
"c8": "^11.0.0",
|
|
76
|
-
"chai": "^
|
|
77
|
-
"eslint": "^
|
|
76
|
+
"chai": "^6.2.2",
|
|
77
|
+
"@eslint/js": "^10.0.0",
|
|
78
|
+
"eslint": "^10.4.1",
|
|
78
79
|
"eslint-import-resolver-typescript": "^4.4.4",
|
|
79
|
-
"eslint-plugin-
|
|
80
|
-
"
|
|
80
|
+
"eslint-plugin-import-x": "^4.16.2",
|
|
81
|
+
"globals": "^17.6.0",
|
|
81
82
|
"esmock": "^2.6.2",
|
|
82
|
-
"mocha": "^
|
|
83
|
+
"mocha": "^11.7.6",
|
|
83
84
|
"msw": "^2.12.7",
|
|
84
|
-
"sinon": "^
|
|
85
|
-
"sinon-chai": "^
|
|
86
|
-
"typescript": "^
|
|
87
|
-
"which": "^
|
|
85
|
+
"sinon": "^22.0.0",
|
|
86
|
+
"sinon-chai": "^4.0.1",
|
|
87
|
+
"typescript": "^6.0.3",
|
|
88
|
+
"which": "^7.0.0"
|
|
88
89
|
},
|
|
89
90
|
"mocha": {
|
|
90
91
|
"check-leaks": false,
|
|
@@ -112,12 +113,10 @@
|
|
|
112
113
|
"reporter": [
|
|
113
114
|
"html",
|
|
114
115
|
"json",
|
|
116
|
+
"lcov",
|
|
115
117
|
"text"
|
|
116
118
|
]
|
|
117
119
|
},
|
|
118
|
-
"eslintIgnore": [
|
|
119
|
-
"index.js"
|
|
120
|
-
],
|
|
121
120
|
"resolutions": {
|
|
122
121
|
"@hapi/joi": "17.1.1"
|
|
123
122
|
}
|