@trustify-da/trustify-da-javascript-client 0.3.0-ea.b40d888 → 0.3.0-ea.c2f6c64
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 +191 -11
- package/dist/package.json +23 -10
- package/dist/src/analysis.d.ts +21 -5
- package/dist/src/analysis.js +74 -80
- package/dist/src/batch_opts.d.ts +24 -0
- package/dist/src/batch_opts.js +35 -0
- package/dist/src/cli.js +241 -8
- package/dist/src/cyclone_dx_sbom.d.ts +10 -2
- package/dist/src/cyclone_dx_sbom.js +32 -5
- package/dist/src/index.d.ts +138 -11
- package/dist/src/index.js +288 -7
- package/dist/src/license/index.d.ts +28 -0
- package/dist/src/license/index.js +100 -0
- package/dist/src/license/license_utils.d.ts +40 -0
- package/dist/src/license/license_utils.js +134 -0
- package/dist/src/license/licenses_api.d.ts +34 -0
- package/dist/src/license/licenses_api.js +98 -0
- package/dist/src/license/project_license.d.ts +20 -0
- package/dist/src/license/project_license.js +62 -0
- package/dist/src/oci_image/images.d.ts +4 -5
- package/dist/src/oci_image/utils.d.ts +4 -4
- package/dist/src/oci_image/utils.js +11 -2
- package/dist/src/provider.d.ts +17 -5
- package/dist/src/provider.js +27 -5
- package/dist/src/providers/base_java.d.ts +3 -5
- package/dist/src/providers/base_javascript.d.ts +29 -7
- package/dist/src/providers/base_javascript.js +129 -22
- package/dist/src/providers/base_pyproject.d.ts +147 -0
- package/dist/src/providers/base_pyproject.js +279 -0
- package/dist/src/providers/golang_gomodules.d.ts +20 -13
- package/dist/src/providers/golang_gomodules.js +112 -114
- 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 +9 -3
- package/dist/src/providers/java_gradle.js +12 -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 +12 -5
- package/dist/src/providers/java_maven.js +33 -5
- package/dist/src/providers/javascript_pnpm.d.ts +1 -1
- package/dist/src/providers/javascript_pnpm.js +2 -2
- package/dist/src/providers/manifest.d.ts +2 -0
- package/dist/src/providers/manifest.js +22 -4
- package/dist/src/providers/processors/yarn_berry_processor.js +82 -3
- package/dist/src/providers/python_controller.d.ts +5 -2
- package/dist/src/providers/python_controller.js +56 -58
- package/dist/src/providers/python_pip.d.ts +11 -4
- package/dist/src/providers/python_pip.js +47 -54
- package/dist/src/providers/python_poetry.d.ts +42 -0
- package/dist/src/providers/python_poetry.js +146 -0
- package/dist/src/providers/python_uv.d.ts +26 -0
- package/dist/src/providers/python_uv.js +118 -0
- package/dist/src/providers/requirements_parser.d.ts +6 -0
- package/dist/src/providers/requirements_parser.js +24 -0
- package/dist/src/providers/rust_cargo.d.ts +52 -0
- package/dist/src/providers/rust_cargo.js +614 -0
- package/dist/src/providers/tree-sitter-gomod.wasm +0 -0
- package/dist/src/providers/tree-sitter-requirements.wasm +0 -0
- package/dist/src/sbom.d.ts +10 -1
- package/dist/src/sbom.js +12 -2
- package/dist/src/tools.d.ts +22 -6
- package/dist/src/tools.js +56 -1
- package/dist/src/workspace.d.ts +61 -0
- package/dist/src/workspace.js +256 -0
- package/package.json +24 -11
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import { environmentVariableIsPopulated, getCustomPath, invokeCommand } from '../tools.js';
|
|
2
|
+
import Base_pyproject from './base_pyproject.js';
|
|
3
|
+
export default class Python_poetry extends Base_pyproject {
|
|
4
|
+
/** @returns {string} */
|
|
5
|
+
_lockFileName() {
|
|
6
|
+
return 'poetry.lock';
|
|
7
|
+
}
|
|
8
|
+
/** @returns {string} */
|
|
9
|
+
_cmdName() {
|
|
10
|
+
return 'poetry';
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* @param {string} manifestDir
|
|
14
|
+
* @param {object} parsed - parsed pyproject.toml
|
|
15
|
+
* @param {Object} opts
|
|
16
|
+
* @returns {Promise<{directDeps: string[], graph: Map<string, {name: string, version: string, children: string[]}>}>}
|
|
17
|
+
*/
|
|
18
|
+
async _getDependencyData(manifestDir, parsed, opts) {
|
|
19
|
+
let treeOutput = this._getPoetryShowTreeOutput(manifestDir, opts);
|
|
20
|
+
let showAllOutput = this._getPoetryShowAllOutput(manifestDir, opts);
|
|
21
|
+
let versionMap = this._parsePoetryShowAll(showAllOutput);
|
|
22
|
+
return this._parsePoetryTree(treeOutput, versionMap);
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Get poetry show --tree output.
|
|
26
|
+
* @param {string} manifestDir
|
|
27
|
+
* @param {Object} opts
|
|
28
|
+
* @returns {string}
|
|
29
|
+
*/
|
|
30
|
+
_getPoetryShowTreeOutput(manifestDir, opts) {
|
|
31
|
+
if (environmentVariableIsPopulated('TRUSTIFY_DA_POETRY_SHOW_TREE')) {
|
|
32
|
+
return Buffer.from(process.env['TRUSTIFY_DA_POETRY_SHOW_TREE'], 'base64').toString('utf-8');
|
|
33
|
+
}
|
|
34
|
+
let poetryBin = getCustomPath('poetry', opts);
|
|
35
|
+
return invokeCommand(poetryBin, ['show', '--tree', '--no-ansi'], { cwd: manifestDir }).toString();
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Get poetry show --all output (flat list with resolved versions).
|
|
39
|
+
* @param {string} manifestDir
|
|
40
|
+
* @param {Object} opts
|
|
41
|
+
* @returns {string}
|
|
42
|
+
*/
|
|
43
|
+
_getPoetryShowAllOutput(manifestDir, opts) {
|
|
44
|
+
if (environmentVariableIsPopulated('TRUSTIFY_DA_POETRY_SHOW_ALL')) {
|
|
45
|
+
return Buffer.from(process.env['TRUSTIFY_DA_POETRY_SHOW_ALL'], 'base64').toString('utf-8');
|
|
46
|
+
}
|
|
47
|
+
let poetryBin = getCustomPath('poetry', opts);
|
|
48
|
+
return invokeCommand(poetryBin, ['show', '--no-ansi', '--all'], { cwd: manifestDir }).toString();
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Parse poetry show --all output into a version map.
|
|
52
|
+
* Lines look like: "name (!) 1.2.3 Description text..."
|
|
53
|
+
* or: "name 1.2.3 Description text..."
|
|
54
|
+
* @param {string} output
|
|
55
|
+
* @returns {Map<string, string>} canonical name -> version
|
|
56
|
+
*/
|
|
57
|
+
_parsePoetryShowAll(output) {
|
|
58
|
+
let versions = new Map();
|
|
59
|
+
let lines = output.split(/\r?\n/);
|
|
60
|
+
for (let line of lines) {
|
|
61
|
+
let trimmed = line.trim();
|
|
62
|
+
if (!trimmed) {
|
|
63
|
+
continue;
|
|
64
|
+
}
|
|
65
|
+
let match = trimmed.match(/^([A-Za-z0-9][A-Za-z0-9._-]*)\s+(?:\(!\)\s+)?(\S+)/);
|
|
66
|
+
if (match) {
|
|
67
|
+
versions.set(this._canonicalize(match[1]), match[2]);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
return versions;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Parse poetry show --tree output into a dependency graph structure.
|
|
74
|
+
* Top-level lines (no indentation/tree chars) are direct deps: "name version description"
|
|
75
|
+
* Indented lines are transitive deps with tree chars: "├── name >=constraint"
|
|
76
|
+
*
|
|
77
|
+
* @param {string} treeOutput
|
|
78
|
+
* @param {Map<string, string>} versionMap - canonical name -> resolved version
|
|
79
|
+
* @returns {{directDeps: string[], graph: Map<string, {name: string, version: string, children: string[]}>}}
|
|
80
|
+
*/
|
|
81
|
+
_parsePoetryTree(treeOutput, versionMap) {
|
|
82
|
+
let lines = treeOutput.split(/\r?\n/);
|
|
83
|
+
let graph = new Map();
|
|
84
|
+
let directDeps = [];
|
|
85
|
+
let stack = []; // [{key, depth}]
|
|
86
|
+
let currentDirectDep = null;
|
|
87
|
+
for (let line of lines) {
|
|
88
|
+
if (!line.trim()) {
|
|
89
|
+
continue;
|
|
90
|
+
}
|
|
91
|
+
// top-level line: "name version description..."
|
|
92
|
+
let topMatch = line.match(/^([A-Za-z0-9][A-Za-z0-9._-]*)\s+(\S+)\s/);
|
|
93
|
+
if (topMatch) {
|
|
94
|
+
let name = topMatch[1];
|
|
95
|
+
let version = topMatch[2];
|
|
96
|
+
let key = this._canonicalize(name);
|
|
97
|
+
directDeps.push(key);
|
|
98
|
+
if (!graph.has(key)) {
|
|
99
|
+
graph.set(key, { name, version, children: [] });
|
|
100
|
+
}
|
|
101
|
+
currentDirectDep = key;
|
|
102
|
+
stack = [{ key, depth: -1 }];
|
|
103
|
+
continue;
|
|
104
|
+
}
|
|
105
|
+
if (!currentDirectDep) {
|
|
106
|
+
continue;
|
|
107
|
+
}
|
|
108
|
+
// indented line with tree chars (UTF-8 box-drawing: ├── └── │)
|
|
109
|
+
let nameStart = line.search(/[A-Za-z0-9]/);
|
|
110
|
+
if (nameStart < 0) {
|
|
111
|
+
continue;
|
|
112
|
+
}
|
|
113
|
+
let rest = line.substring(nameStart);
|
|
114
|
+
let depMatch = rest.match(/^([A-Za-z0-9][A-Za-z0-9._-]*)/);
|
|
115
|
+
if (!depMatch) {
|
|
116
|
+
continue;
|
|
117
|
+
}
|
|
118
|
+
let depName = depMatch[1];
|
|
119
|
+
let depKey = this._canonicalize(depName);
|
|
120
|
+
// determine depth by counting tree-drawing groups in the prefix
|
|
121
|
+
let prefix = line.substring(0, nameStart);
|
|
122
|
+
let depth = (prefix.match(/(?:[├└│ ][\s─]{2} ?)/g) || []).length;
|
|
123
|
+
// resolve version from the version map
|
|
124
|
+
let version = versionMap.get(depKey) || null;
|
|
125
|
+
if (!version) {
|
|
126
|
+
throw new Error(`poetry: package '${depName}' has no resolved version`);
|
|
127
|
+
}
|
|
128
|
+
if (!graph.has(depKey)) {
|
|
129
|
+
graph.set(depKey, { name: depName, version, children: [] });
|
|
130
|
+
}
|
|
131
|
+
// pop stack back to find the parent at depth-1
|
|
132
|
+
while (stack.length > 0 && stack[stack.length - 1].depth >= depth) {
|
|
133
|
+
stack.pop();
|
|
134
|
+
}
|
|
135
|
+
if (stack.length > 0) {
|
|
136
|
+
let parentKey = stack[stack.length - 1].key;
|
|
137
|
+
let parentEntry = graph.get(parentKey);
|
|
138
|
+
if (parentEntry && !parentEntry.children.includes(depKey)) {
|
|
139
|
+
parentEntry.children.push(depKey);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
stack.push({ key: depKey, depth });
|
|
143
|
+
}
|
|
144
|
+
return { directDeps, graph };
|
|
145
|
+
}
|
|
146
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export default class Python_uv extends Base_pyproject {
|
|
2
|
+
/**
|
|
3
|
+
* Get the uv export output, either from env var or by running the command.
|
|
4
|
+
* @param {string} manifestDir
|
|
5
|
+
* @param {Object} opts
|
|
6
|
+
* @returns {string}
|
|
7
|
+
*/
|
|
8
|
+
_getUvExportOutput(manifestDir: string, opts: any): string;
|
|
9
|
+
/**
|
|
10
|
+
* Parse uv export output into a dependency graph using tree-sitter-requirements
|
|
11
|
+
* for package/version extraction and string parsing for "# via" comments.
|
|
12
|
+
*
|
|
13
|
+
* @param {string} output
|
|
14
|
+
* @param {string} projectName - canonical project name to identify direct deps
|
|
15
|
+
* @returns {Promise<{directDeps: string[], graph: Map<string, {name: string, version: string, children: string[]}>}>}
|
|
16
|
+
*/
|
|
17
|
+
_parseUvExport(output: string, projectName: string): Promise<{
|
|
18
|
+
directDeps: string[];
|
|
19
|
+
graph: Map<string, {
|
|
20
|
+
name: string;
|
|
21
|
+
version: string;
|
|
22
|
+
children: string[];
|
|
23
|
+
}>;
|
|
24
|
+
}>;
|
|
25
|
+
}
|
|
26
|
+
import Base_pyproject from './base_pyproject.js';
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { environmentVariableIsPopulated, getCustomPath, invokeCommand } from '../tools.js';
|
|
2
|
+
import Base_pyproject from './base_pyproject.js';
|
|
3
|
+
import { getParser, getPinnedVersionQuery } from './requirements_parser.js';
|
|
4
|
+
export default class Python_uv extends Base_pyproject {
|
|
5
|
+
/** @returns {string} */
|
|
6
|
+
_lockFileName() {
|
|
7
|
+
return 'uv.lock';
|
|
8
|
+
}
|
|
9
|
+
/** @returns {string} */
|
|
10
|
+
_cmdName() {
|
|
11
|
+
return 'uv';
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* @param {string} manifestDir
|
|
15
|
+
* @param {object} parsed - parsed pyproject.toml
|
|
16
|
+
* @param {Object} opts
|
|
17
|
+
* @returns {Promise<{directDeps: string[], graph: Map<string, {name: string, version: string, children: string[]}>}>}
|
|
18
|
+
*/
|
|
19
|
+
async _getDependencyData(manifestDir, parsed, opts) {
|
|
20
|
+
let projectName = this._getProjectName(parsed);
|
|
21
|
+
let uvOutput = this._getUvExportOutput(manifestDir, opts);
|
|
22
|
+
return this._parseUvExport(uvOutput, projectName);
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Get the uv export output, either from env var or by running the command.
|
|
26
|
+
* @param {string} manifestDir
|
|
27
|
+
* @param {Object} opts
|
|
28
|
+
* @returns {string}
|
|
29
|
+
*/
|
|
30
|
+
_getUvExportOutput(manifestDir, opts) {
|
|
31
|
+
if (environmentVariableIsPopulated('TRUSTIFY_DA_UV_EXPORT')) {
|
|
32
|
+
return Buffer.from(process.env['TRUSTIFY_DA_UV_EXPORT'], 'base64').toString('ascii');
|
|
33
|
+
}
|
|
34
|
+
let uvBin = getCustomPath('uv', opts);
|
|
35
|
+
return invokeCommand(uvBin, ['export', '--format', 'requirements.txt', '--frozen', '--no-hashes'], { cwd: manifestDir }).toString();
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Parse uv export output into a dependency graph using tree-sitter-requirements
|
|
39
|
+
* for package/version extraction and string parsing for "# via" comments.
|
|
40
|
+
*
|
|
41
|
+
* @param {string} output
|
|
42
|
+
* @param {string} projectName - canonical project name to identify direct deps
|
|
43
|
+
* @returns {Promise<{directDeps: string[], graph: Map<string, {name: string, version: string, children: string[]}>}>}
|
|
44
|
+
*/
|
|
45
|
+
async _parseUvExport(output, projectName) {
|
|
46
|
+
let [parser, pinnedVersionQuery] = await Promise.all([
|
|
47
|
+
getParser(), getPinnedVersionQuery()
|
|
48
|
+
]);
|
|
49
|
+
let tree = parser.parse(output);
|
|
50
|
+
let root = tree.rootNode;
|
|
51
|
+
let canonProjectName = this._canonicalize(projectName);
|
|
52
|
+
let packages = new Map(); // canonical name -> {name, version, parents: Set}
|
|
53
|
+
let currentPkg = null;
|
|
54
|
+
let collectingVia = false;
|
|
55
|
+
for (let child of root.children) {
|
|
56
|
+
if (child.type === 'requirement') {
|
|
57
|
+
let nameNode = child.children.find(c => c.type === 'package');
|
|
58
|
+
if (!nameNode) {
|
|
59
|
+
continue;
|
|
60
|
+
}
|
|
61
|
+
let name = nameNode.text;
|
|
62
|
+
let version = null;
|
|
63
|
+
let versionMatches = pinnedVersionQuery.matches(child);
|
|
64
|
+
if (versionMatches.length > 0) {
|
|
65
|
+
version = versionMatches[0].captures.find(c => c.name === 'version').node.text;
|
|
66
|
+
}
|
|
67
|
+
if (!version) {
|
|
68
|
+
throw new Error(`uv export: package '${name}' has no pinned version`);
|
|
69
|
+
}
|
|
70
|
+
let key = this._canonicalize(name);
|
|
71
|
+
currentPkg = { name, version, parents: new Set() };
|
|
72
|
+
packages.set(key, currentPkg);
|
|
73
|
+
collectingVia = false;
|
|
74
|
+
continue;
|
|
75
|
+
}
|
|
76
|
+
if (child.type === 'comment' && currentPkg) {
|
|
77
|
+
let text = child.text.trim();
|
|
78
|
+
let viaSingle = text.match(/^# via ([A-Za-z0-9][A-Za-z0-9._-]*)$/);
|
|
79
|
+
if (viaSingle) {
|
|
80
|
+
currentPkg.parents.add(this._canonicalize(viaSingle[1]));
|
|
81
|
+
collectingVia = false;
|
|
82
|
+
continue;
|
|
83
|
+
}
|
|
84
|
+
if (text === '# via') {
|
|
85
|
+
collectingVia = true;
|
|
86
|
+
continue;
|
|
87
|
+
}
|
|
88
|
+
if (collectingVia) {
|
|
89
|
+
let parentMatch = text.match(/^#\s+([A-Za-z0-9][A-Za-z0-9._-]*)$/);
|
|
90
|
+
if (parentMatch) {
|
|
91
|
+
currentPkg.parents.add(this._canonicalize(parentMatch[1]));
|
|
92
|
+
continue;
|
|
93
|
+
}
|
|
94
|
+
collectingVia = false;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
// Build forward dependency map and extract direct deps in one pass
|
|
99
|
+
let graph = new Map();
|
|
100
|
+
let directDeps = [];
|
|
101
|
+
for (let [key, pkg] of packages) {
|
|
102
|
+
graph.set(key, { name: pkg.name, version: pkg.version, children: [] });
|
|
103
|
+
}
|
|
104
|
+
for (let [childKey, pkg] of packages) {
|
|
105
|
+
for (let parentKey of pkg.parents) {
|
|
106
|
+
if (parentKey === canonProjectName) {
|
|
107
|
+
directDeps.push(childKey);
|
|
108
|
+
continue;
|
|
109
|
+
}
|
|
110
|
+
let parentEntry = graph.get(parentKey);
|
|
111
|
+
if (parentEntry) {
|
|
112
|
+
parentEntry.children.push(childKey);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
return { directDeps, graph };
|
|
117
|
+
}
|
|
118
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export function getParser(): Promise<Parser>;
|
|
2
|
+
export function getRequirementQuery(): Promise<Query>;
|
|
3
|
+
export function getIgnoreQuery(): Promise<Query>;
|
|
4
|
+
export function getPinnedVersionQuery(): Promise<Query>;
|
|
5
|
+
import { Parser } from 'web-tree-sitter';
|
|
6
|
+
import { Query } from 'web-tree-sitter';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { readFile } from 'node:fs/promises';
|
|
2
|
+
import { Language, Parser, Query } from 'web-tree-sitter';
|
|
3
|
+
const wasmUrl = new URL('./tree-sitter-requirements.wasm', import.meta.url);
|
|
4
|
+
async function init() {
|
|
5
|
+
await Parser.init();
|
|
6
|
+
const wasmBytes = new Uint8Array(await readFile(wasmUrl));
|
|
7
|
+
return await Language.load(wasmBytes);
|
|
8
|
+
}
|
|
9
|
+
export async function getParser() {
|
|
10
|
+
const language = await init();
|
|
11
|
+
return new Parser().setLanguage(language);
|
|
12
|
+
}
|
|
13
|
+
export async function getRequirementQuery() {
|
|
14
|
+
const language = await init();
|
|
15
|
+
return new Query(language, '(requirement (package) @name) @req');
|
|
16
|
+
}
|
|
17
|
+
export async function getIgnoreQuery() {
|
|
18
|
+
const language = await init();
|
|
19
|
+
return new Query(language, '((requirement (package) @name) @req . (comment) @comment (#match? @comment "^#[\\t ]*exhortignore"))');
|
|
20
|
+
}
|
|
21
|
+
export async function getPinnedVersionQuery() {
|
|
22
|
+
const language = await init();
|
|
23
|
+
return new Query(language, '(version_spec (version_cmp) @cmp (version) @version (#eq? @cmp "=="))');
|
|
24
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
declare namespace _default {
|
|
2
|
+
export { isSupported };
|
|
3
|
+
export { validateLockFile };
|
|
4
|
+
export { provideComponent };
|
|
5
|
+
export { provideStack };
|
|
6
|
+
export { readLicenseFromManifest };
|
|
7
|
+
}
|
|
8
|
+
export default _default;
|
|
9
|
+
export type Provided = import("../provider").Provided;
|
|
10
|
+
/**
|
|
11
|
+
* @param {string} manifestName - the subject manifest name-type
|
|
12
|
+
* @returns {boolean} - return true if `Cargo.toml` is the manifest name-type
|
|
13
|
+
*/
|
|
14
|
+
declare function isSupported(manifestName: string): boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Validates that Cargo.lock exists in the manifest directory or in a parent
|
|
17
|
+
* workspace root directory. In Cargo workspaces the lock file always lives at
|
|
18
|
+
* the workspace root, so when a member crate's Cargo.toml is provided we walk
|
|
19
|
+
* up the directory tree looking for Cargo.lock (stopping when we find a
|
|
20
|
+
* Cargo.toml that contains a [workspace] section, or when we reach the
|
|
21
|
+
* filesystem root).
|
|
22
|
+
* When TRUSTIFY_DA_WORKSPACE_DIR is provided (via env var or opts),
|
|
23
|
+
* checks only that directory for Cargo.lock — no walk-up.
|
|
24
|
+
* @param {string} manifestDir - the directory where the manifest lies
|
|
25
|
+
* @param {{TRUSTIFY_DA_WORKSPACE_DIR?: string}} [opts={}] - optional workspace root
|
|
26
|
+
* @returns {boolean} true if Cargo.lock is found
|
|
27
|
+
*/
|
|
28
|
+
declare function validateLockFile(manifestDir: string, opts?: {
|
|
29
|
+
TRUSTIFY_DA_WORKSPACE_DIR?: string;
|
|
30
|
+
}): boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Provide content and content type for Cargo component analysis.
|
|
33
|
+
* @param {string} manifest - path to Cargo.toml for component report
|
|
34
|
+
* @param {{}} [opts={}] - optional various options to pass along the application
|
|
35
|
+
* @returns {Provided}
|
|
36
|
+
*/
|
|
37
|
+
declare function provideComponent(manifest: string, opts?: {}): Provided;
|
|
38
|
+
/**
|
|
39
|
+
* Provide content and content type for Cargo stack analysis.
|
|
40
|
+
* @param {string} manifest - the manifest path
|
|
41
|
+
* @param {{}} [opts={}] - optional various options to pass along the application
|
|
42
|
+
* @returns {Provided}
|
|
43
|
+
*/
|
|
44
|
+
declare function provideStack(manifest: string, opts?: {}): Provided;
|
|
45
|
+
/**
|
|
46
|
+
* Read project license from Cargo.toml, with fallback to LICENSE file.
|
|
47
|
+
* Supports the `license` field under `[package]` (single crate / workspace
|
|
48
|
+
* with root) and under `[workspace.package]` (virtual workspaces).
|
|
49
|
+
* @param {string} manifestPath - path to Cargo.toml
|
|
50
|
+
* @returns {string|null} SPDX identifier or null
|
|
51
|
+
*/
|
|
52
|
+
declare function readLicenseFromManifest(manifestPath: string): string | null;
|