@trustify-da/trustify-da-javascript-client 0.3.0-ea.6549d2a → 0.3.0-ea.68905d3
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 +368 -14
- package/dist/package.json +39 -26
- package/dist/src/analysis.d.ts +28 -5
- package/dist/src/analysis.js +78 -13
- package/dist/src/batch_opts.d.ts +24 -0
- package/dist/src/batch_opts.js +35 -0
- package/dist/src/cli.js +287 -5
- package/dist/src/cyclone_dx_sbom.d.ts +27 -1
- package/dist/src/cyclone_dx_sbom.js +84 -10
- package/dist/src/index.d.ts +145 -8
- package/dist/src/index.js +362 -28
- package/dist/src/license/index.d.ts +5 -5
- package/dist/src/license/index.js +8 -5
- package/dist/src/license/license_utils.d.ts +40 -0
- package/dist/src/license/license_utils.js +137 -0
- package/dist/src/license/licenses_api.d.ts +2 -2
- package/dist/src/license/licenses_api.js +9 -2
- package/dist/src/license/project_license.d.ts +1 -6
- package/dist/src/license/project_license.js +4 -81
- 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/package_version.d.ts +8 -0
- package/dist/src/package_version.js +31 -0
- package/dist/src/provider.d.ts +8 -4
- package/dist/src/provider.js +18 -5
- 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 +91 -10
- package/dist/src/providers/base_javascript.js +220 -28
- 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 +23 -13
- package/dist/src/providers/golang_gomodules.js +210 -121
- package/dist/src/providers/gomod_parser.d.ts +4 -0
- package/dist/src/providers/gomod_parser.js +16 -0
- package/dist/src/providers/java_gradle.d.ts +67 -0
- package/dist/src/providers/java_gradle.js +314 -21
- 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 -10
- package/dist/src/providers/java_maven.js +279 -20
- 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 -0
- package/dist/src/providers/javascript_npm.js +61 -1
- package/dist/src/providers/javascript_pnpm.d.ts +14 -1
- package/dist/src/providers/javascript_pnpm.js +55 -5
- package/dist/src/providers/javascript_yarn.d.ts +12 -0
- package/dist/src/providers/javascript_yarn.js +75 -2
- package/dist/src/providers/manifest.d.ts +2 -0
- package/dist/src/providers/manifest.js +28 -7
- 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 +91 -7
- 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 +69 -8
- package/dist/src/providers/python_pip.d.ts +5 -0
- package/dist/src/providers/python_pip.js +8 -7
- 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/requirements_parser.js +5 -4
- package/dist/src/providers/rust_cargo.d.ts +56 -0
- package/dist/src/providers/rust_cargo.js +682 -0
- package/dist/src/providers/tree-sitter-containerfile.wasm +0 -0
- package/dist/src/providers/tree-sitter-gomod.wasm +0 -0
- package/dist/src/providers/tree-sitter-requirements.wasm +0 -0
- package/dist/src/remediate.d.ts +117 -0
- package/dist/src/remediate.js +249 -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 +25 -1
- package/dist/src/sbom.js +23 -2
- package/dist/src/tools.d.ts +28 -2
- package/dist/src/tools.js +82 -1
- package/dist/src/updaters/maven_updater.d.ts +58 -0
- package/dist/src/updaters/maven_updater.js +345 -0
- package/dist/src/updaters/toml_updater.d.ts +62 -0
- package/dist/src/updaters/toml_updater.js +276 -0
- package/dist/src/workspace.d.ts +70 -0
- package/dist/src/workspace.js +256 -0
- package/package.json +40 -27
- package/dist/src/license/compatibility.d.ts +0 -18
- package/dist/src/license/compatibility.js +0 -45
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.68905d3",
|
|
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",
|
|
@@ -25,7 +25,9 @@
|
|
|
25
25
|
"provenance": true
|
|
26
26
|
},
|
|
27
27
|
"type": "module",
|
|
28
|
-
"bin":
|
|
28
|
+
"bin": {
|
|
29
|
+
"trustify-da": "dist/src/cli.js"
|
|
30
|
+
},
|
|
29
31
|
"main": "dist/src/index.js",
|
|
30
32
|
"module": "dist/src/index.js",
|
|
31
33
|
"types": "dist/src/index.d.ts",
|
|
@@ -35,47 +37,57 @@
|
|
|
35
37
|
"config/**/*"
|
|
36
38
|
],
|
|
37
39
|
"scripts": {
|
|
38
|
-
"lint": "eslint src test
|
|
39
|
-
"lint:fix": "eslint src test --
|
|
40
|
+
"lint": "eslint src test",
|
|
41
|
+
"lint:fix": "eslint src test --fix",
|
|
40
42
|
"test": "c8 npm run tests",
|
|
41
|
-
"tests": "mocha --config .mocharc.json
|
|
43
|
+
"tests": "mocha --config .mocharc.json",
|
|
42
44
|
"tests:rep": "mocha --reporter-option maxDiffSize=0 --reporter json > unit-tests-result.json",
|
|
45
|
+
"pretest": "cp node_modules/tree-sitter-requirements/tree-sitter-requirements.wasm src/providers/tree-sitter-requirements.wasm && cp node_modules/tree-sitter-gomod/tree-sitter-gomod.wasm src/providers/tree-sitter-gomod.wasm && cp node_modules/tree-sitter-containerfile/tree-sitter-containerfile.wasm src/providers/tree-sitter-containerfile.wasm",
|
|
43
46
|
"precompile": "rm -rf dist",
|
|
44
|
-
"compile": "tsc -p tsconfig.json"
|
|
47
|
+
"compile": "tsc -p tsconfig.json",
|
|
48
|
+
"compile:dev": "tsc -p tsconfig.dev.json",
|
|
49
|
+
"postcompile": "cp node_modules/tree-sitter-requirements/tree-sitter-requirements.wasm dist/src/providers/tree-sitter-requirements.wasm && cp node_modules/tree-sitter-gomod/tree-sitter-gomod.wasm dist/src/providers/tree-sitter-gomod.wasm && cp node_modules/tree-sitter-containerfile/tree-sitter-containerfile.wasm dist/src/providers/tree-sitter-containerfile.wasm"
|
|
45
50
|
},
|
|
46
51
|
"dependencies": {
|
|
47
|
-
"@
|
|
48
|
-
"@cyclonedx/cyclonedx-library": "^6.13.0",
|
|
52
|
+
"@yarnpkg/parsers": "^3.1.0",
|
|
49
53
|
"eslint-import-resolver-typescript": "^4.4.4",
|
|
50
|
-
"fast-
|
|
54
|
+
"fast-glob": "^3.3.3",
|
|
51
55
|
"fast-xml-parser": "^5.3.4",
|
|
52
56
|
"help": "^3.0.2",
|
|
53
|
-
"https-proxy-agent": "^
|
|
57
|
+
"https-proxy-agent": "^9.0.0",
|
|
58
|
+
"js-yaml": "^4.1.1",
|
|
59
|
+
"jsonc-parser": "^3.3.1",
|
|
60
|
+
"micromatch": "^4.0.8",
|
|
54
61
|
"node-fetch": "^3.3.2",
|
|
62
|
+
"p-limit": "^7.3.0",
|
|
55
63
|
"packageurl-js": "~1.0.2",
|
|
64
|
+
"smol-toml": "^1.6.0",
|
|
65
|
+
"tree-sitter-containerfile": "^0.8.1",
|
|
66
|
+
"tree-sitter-gomod": "github:strum355/tree-sitter-go-mod#56326f2ad478892ace58ff247a97d492a3cbcdda",
|
|
56
67
|
"tree-sitter-requirements": "github:Strum355/tree-sitter-requirements#d0261ee76b84253997fe70d7d397e78c006c3801",
|
|
57
|
-
"web-tree-sitter": "^0.26.
|
|
68
|
+
"web-tree-sitter": "^0.26.7",
|
|
58
69
|
"yargs": "^18.0.0"
|
|
59
70
|
},
|
|
60
71
|
"devDependencies": {
|
|
61
|
-
"@
|
|
62
|
-
"@
|
|
63
|
-
"@
|
|
72
|
+
"@cyclonedx/cyclonedx-library": "^10.2.0",
|
|
73
|
+
"@eslint/js": "^10.0.0",
|
|
74
|
+
"@trustify-da/trustify-da-api-model": "^2.0.12",
|
|
75
|
+
"@types/node": "^25.9.1",
|
|
64
76
|
"@types/which": "^3.0.4",
|
|
65
|
-
"
|
|
77
|
+
"ajv": "^8.20.0",
|
|
66
78
|
"c8": "^11.0.0",
|
|
67
|
-
"chai": "^
|
|
68
|
-
"eslint": "^
|
|
79
|
+
"chai": "^6.2.2",
|
|
80
|
+
"eslint": "^10.4.1",
|
|
69
81
|
"eslint-import-resolver-typescript": "^4.4.4",
|
|
70
|
-
"eslint-plugin-
|
|
71
|
-
"eslint-plugin-import": "^2.29.1",
|
|
82
|
+
"eslint-plugin-import-x": "^4.16.2",
|
|
72
83
|
"esmock": "^2.6.2",
|
|
73
|
-
"
|
|
84
|
+
"globals": "^17.6.0",
|
|
85
|
+
"mocha": "^11.7.6",
|
|
74
86
|
"msw": "^2.12.7",
|
|
75
|
-
"sinon": "^
|
|
76
|
-
"sinon-chai": "^
|
|
77
|
-
"typescript": "^
|
|
78
|
-
"which": "^
|
|
87
|
+
"sinon": "^22.0.0",
|
|
88
|
+
"sinon-chai": "^4.0.1",
|
|
89
|
+
"typescript": "^6.0.3",
|
|
90
|
+
"which": "^7.0.0"
|
|
79
91
|
},
|
|
80
92
|
"mocha": {
|
|
81
93
|
"check-leaks": false,
|
|
@@ -103,12 +115,13 @@
|
|
|
103
115
|
"reporter": [
|
|
104
116
|
"html",
|
|
105
117
|
"json",
|
|
118
|
+
"lcov",
|
|
106
119
|
"text"
|
|
107
120
|
]
|
|
108
121
|
},
|
|
109
|
-
"
|
|
110
|
-
"
|
|
111
|
-
|
|
122
|
+
"overrides": {
|
|
123
|
+
"tree-sitter": "0.22.4"
|
|
124
|
+
},
|
|
112
125
|
"resolutions": {
|
|
113
126
|
"@hapi/joi": "17.1.1"
|
|
114
127
|
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* License compatibility: whether a dependency license is compatible with the project license.
|
|
3
|
-
* Relies on backend-provided license categories.
|
|
4
|
-
*
|
|
5
|
-
* Compatibility is based on restrictiveness hierarchy:
|
|
6
|
-
* PERMISSIVE < WEAK_COPYLEFT < STRONG_COPYLEFT
|
|
7
|
-
*
|
|
8
|
-
* A dependency is compatible if it's equal or less restrictive than the project license.
|
|
9
|
-
* A dependency is incompatible if it's more restrictive than the project license.
|
|
10
|
-
*/
|
|
11
|
-
/**
|
|
12
|
-
* Check if a dependency's license is compatible with the project license based on backend categories.
|
|
13
|
-
*
|
|
14
|
-
* @param {string} [projectCategory] - backend category for project license: PERMISSIVE | WEAK_COPYLEFT | STRONG_COPYLEFT | UNKNOWN
|
|
15
|
-
* @param {string} [dependencyCategory] - backend category for dependency license: PERMISSIVE | WEAK_COPYLEFT | STRONG_COPYLEFT | UNKNOWN
|
|
16
|
-
* @returns {'compatible'|'incompatible'|'unknown'}
|
|
17
|
-
*/
|
|
18
|
-
export function getCompatibility(projectCategory?: string, dependencyCategory?: string): "compatible" | "incompatible" | "unknown";
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* License compatibility: whether a dependency license is compatible with the project license.
|
|
3
|
-
* Relies on backend-provided license categories.
|
|
4
|
-
*
|
|
5
|
-
* Compatibility is based on restrictiveness hierarchy:
|
|
6
|
-
* PERMISSIVE < WEAK_COPYLEFT < STRONG_COPYLEFT
|
|
7
|
-
*
|
|
8
|
-
* A dependency is compatible if it's equal or less restrictive than the project license.
|
|
9
|
-
* A dependency is incompatible if it's more restrictive than the project license.
|
|
10
|
-
*/
|
|
11
|
-
/**
|
|
12
|
-
* Check if a dependency's license is compatible with the project license based on backend categories.
|
|
13
|
-
*
|
|
14
|
-
* @param {string} [projectCategory] - backend category for project license: PERMISSIVE | WEAK_COPYLEFT | STRONG_COPYLEFT | UNKNOWN
|
|
15
|
-
* @param {string} [dependencyCategory] - backend category for dependency license: PERMISSIVE | WEAK_COPYLEFT | STRONG_COPYLEFT | UNKNOWN
|
|
16
|
-
* @returns {'compatible'|'incompatible'|'unknown'}
|
|
17
|
-
*/
|
|
18
|
-
export function getCompatibility(projectCategory, dependencyCategory) {
|
|
19
|
-
if (!projectCategory || !dependencyCategory) {
|
|
20
|
-
return 'unknown';
|
|
21
|
-
}
|
|
22
|
-
const proj = projectCategory.toUpperCase();
|
|
23
|
-
const dep = dependencyCategory.toUpperCase();
|
|
24
|
-
// Unknown categories
|
|
25
|
-
if (proj === 'UNKNOWN' || dep === 'UNKNOWN') {
|
|
26
|
-
return 'unknown';
|
|
27
|
-
}
|
|
28
|
-
// Define restrictiveness levels (higher number = more restrictive)
|
|
29
|
-
const restrictiveness = {
|
|
30
|
-
'PERMISSIVE': 1,
|
|
31
|
-
'WEAK_COPYLEFT': 2,
|
|
32
|
-
'STRONG_COPYLEFT': 3
|
|
33
|
-
};
|
|
34
|
-
const projLevel = restrictiveness[proj];
|
|
35
|
-
const depLevel = restrictiveness[dep];
|
|
36
|
-
if (projLevel === undefined || depLevel === undefined) {
|
|
37
|
-
return 'unknown';
|
|
38
|
-
}
|
|
39
|
-
// Dependency is more restrictive than project → incompatible
|
|
40
|
-
if (depLevel > projLevel) {
|
|
41
|
-
return 'incompatible';
|
|
42
|
-
}
|
|
43
|
-
// Dependency is equal or less restrictive → compatible
|
|
44
|
-
return 'compatible';
|
|
45
|
-
}
|