@cyclonedx/cdxgen 12.1.5 → 12.2.1
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 +51 -40
- package/bin/cdxgen.js +194 -97
- package/bin/evinse.js +4 -4
- package/bin/repl.js +1 -1
- package/bin/sign.js +102 -0
- package/bin/validate.js +233 -0
- package/bin/verify.js +69 -28
- package/data/queries.json +1 -1
- package/data/rules/ci-permissions.yaml +186 -0
- package/data/rules/dependency-sources.yaml +123 -0
- package/data/rules/package-integrity.yaml +135 -0
- package/data/rules/vscode-extensions.yaml +228 -0
- package/lib/cli/index.js +449 -429
- package/lib/cli/index.poku.js +117 -0
- package/lib/evinser/db.js +137 -0
- package/lib/{helpers → evinser}/db.poku.js +2 -6
- package/lib/evinser/evinser.js +2 -14
- package/lib/helpers/analyzer.js +606 -3
- package/lib/helpers/analyzer.poku.js +230 -0
- package/lib/helpers/bomSigner.js +312 -0
- package/lib/helpers/bomSigner.poku.js +156 -0
- package/lib/helpers/ciParsers/azurePipelines.js +295 -0
- package/lib/helpers/ciParsers/azurePipelines.poku.js +253 -0
- package/lib/helpers/ciParsers/circleCi.js +286 -0
- package/lib/helpers/ciParsers/circleCi.poku.js +230 -0
- package/lib/helpers/ciParsers/common.js +24 -0
- package/lib/helpers/ciParsers/githubActions.js +636 -0
- package/lib/helpers/ciParsers/githubActions.poku.js +802 -0
- package/lib/helpers/ciParsers/gitlabCi.js +213 -0
- package/lib/helpers/ciParsers/gitlabCi.poku.js +247 -0
- package/lib/helpers/ciParsers/jenkins.js +181 -0
- package/lib/helpers/ciParsers/jenkins.poku.js +197 -0
- package/lib/helpers/depsUtils.js +219 -0
- package/lib/helpers/depsUtils.poku.js +207 -0
- package/lib/helpers/display.js +426 -5
- package/lib/helpers/envcontext.js +18 -3
- package/lib/helpers/formulationParsers.js +351 -0
- package/lib/helpers/logger.js +14 -0
- package/lib/helpers/protobom.js +9 -9
- package/lib/helpers/pythonutils.js +9 -0
- package/lib/helpers/remote/dependency-track.js +84 -0
- package/lib/helpers/remote/dependency-track.poku.js +119 -0
- package/lib/helpers/table.js +384 -0
- package/lib/helpers/table.poku.js +186 -0
- package/lib/helpers/utils.js +865 -416
- package/lib/helpers/utils.poku.js +172 -265
- package/lib/helpers/versutils.js +202 -0
- package/lib/helpers/versutils.poku.js +315 -0
- package/lib/helpers/vsixutils.js +1061 -0
- package/lib/helpers/vsixutils.poku.js +2247 -0
- package/lib/managers/binary.js +19 -19
- package/lib/managers/docker.js +108 -1
- package/lib/managers/oci.js +10 -0
- package/lib/managers/piptree.js +3 -9
- package/lib/parsers/npmrc.js +17 -13
- package/lib/parsers/npmrc.poku.js +41 -5
- package/lib/server/openapi.yaml +34 -1
- package/lib/server/server.js +50 -13
- package/lib/server/server.poku.js +332 -144
- package/lib/stages/postgen/annotator.js +1 -1
- package/lib/stages/postgen/auditBom.js +196 -0
- package/lib/stages/postgen/auditBom.poku.js +378 -0
- package/lib/stages/postgen/postgen.js +54 -1
- package/lib/stages/postgen/postgen.poku.js +90 -1
- package/lib/stages/postgen/ruleEngine.js +369 -0
- package/lib/stages/pregen/envAudit.js +299 -0
- package/lib/stages/pregen/envAudit.poku.js +572 -0
- package/lib/stages/pregen/pregen.js +12 -8
- package/lib/{helpers/validator.js → validator/bomValidator.js} +107 -47
- package/lib/validator/complianceEngine.js +241 -0
- package/lib/validator/complianceEngine.poku.js +168 -0
- package/lib/validator/complianceRules.js +1610 -0
- package/lib/validator/complianceRules.poku.js +328 -0
- package/lib/validator/index.js +222 -0
- package/lib/validator/index.poku.js +144 -0
- package/lib/validator/reporters/annotations.js +121 -0
- package/lib/validator/reporters/console.js +149 -0
- package/lib/validator/reporters/index.js +41 -0
- package/lib/validator/reporters/json.js +37 -0
- package/lib/validator/reporters/sarif.js +184 -0
- package/lib/validator/reporters.poku.js +150 -0
- package/package.json +8 -9
- package/types/bin/sign.d.ts +3 -0
- package/types/bin/sign.d.ts.map +1 -0
- package/types/bin/validate.d.ts +3 -0
- package/types/bin/validate.d.ts.map +1 -0
- package/types/helpers/utils.d.ts +0 -1
- package/types/lib/cli/index.d.ts +49 -52
- package/types/lib/cli/index.d.ts.map +1 -1
- package/types/lib/evinser/db.d.ts +34 -0
- package/types/lib/evinser/db.d.ts.map +1 -0
- package/types/lib/evinser/evinser.d.ts +63 -16
- package/types/lib/evinser/evinser.d.ts.map +1 -1
- package/types/lib/helpers/analyzer.d.ts.map +1 -1
- package/types/lib/helpers/bomSigner.d.ts +27 -0
- package/types/lib/helpers/bomSigner.d.ts.map +1 -0
- package/types/lib/helpers/ciParsers/azurePipelines.d.ts +17 -0
- package/types/lib/helpers/ciParsers/azurePipelines.d.ts.map +1 -0
- package/types/lib/helpers/ciParsers/circleCi.d.ts +17 -0
- package/types/lib/helpers/ciParsers/circleCi.d.ts.map +1 -0
- package/types/lib/helpers/ciParsers/common.d.ts +11 -0
- package/types/lib/helpers/ciParsers/common.d.ts.map +1 -0
- package/types/lib/helpers/ciParsers/githubActions.d.ts +34 -0
- package/types/lib/helpers/ciParsers/githubActions.d.ts.map +1 -0
- package/types/lib/helpers/ciParsers/gitlabCi.d.ts +17 -0
- package/types/lib/helpers/ciParsers/gitlabCi.d.ts.map +1 -0
- package/types/lib/helpers/ciParsers/jenkins.d.ts +17 -0
- package/types/lib/helpers/ciParsers/jenkins.d.ts.map +1 -0
- package/types/lib/helpers/depsUtils.d.ts +21 -0
- package/types/lib/helpers/depsUtils.d.ts.map +1 -0
- package/types/lib/helpers/display.d.ts +111 -11
- package/types/lib/helpers/display.d.ts.map +1 -1
- package/types/lib/helpers/envcontext.d.ts +19 -7
- package/types/lib/helpers/envcontext.d.ts.map +1 -1
- package/types/lib/helpers/formulationParsers.d.ts +50 -0
- package/types/lib/helpers/formulationParsers.d.ts.map +1 -0
- package/types/lib/helpers/logger.d.ts +15 -1
- package/types/lib/helpers/logger.d.ts.map +1 -1
- package/types/lib/helpers/protobom.d.ts +2 -2
- package/types/lib/helpers/pythonutils.d.ts +10 -1
- package/types/lib/helpers/pythonutils.d.ts.map +1 -1
- package/types/lib/helpers/remote/dependency-track.d.ts +16 -0
- package/types/lib/helpers/remote/dependency-track.d.ts.map +1 -0
- package/types/lib/helpers/table.d.ts +6 -0
- package/types/lib/helpers/table.d.ts.map +1 -0
- package/types/lib/helpers/utils.d.ts +533 -128
- package/types/lib/helpers/utils.d.ts.map +1 -1
- package/types/lib/helpers/versutils.d.ts +8 -0
- package/types/lib/helpers/versutils.d.ts.map +1 -0
- package/types/lib/helpers/vsixutils.d.ts +130 -0
- package/types/lib/helpers/vsixutils.d.ts.map +1 -0
- package/types/lib/managers/docker.d.ts +12 -31
- package/types/lib/managers/docker.d.ts.map +1 -1
- package/types/lib/managers/oci.d.ts +11 -1
- package/types/lib/managers/oci.d.ts.map +1 -1
- package/types/lib/managers/piptree.d.ts.map +1 -1
- package/types/lib/parsers/npmrc.d.ts +4 -1
- package/types/lib/parsers/npmrc.d.ts.map +1 -1
- package/types/lib/server/server.d.ts +22 -2
- package/types/lib/server/server.d.ts.map +1 -1
- package/types/lib/stages/postgen/auditBom.d.ts +20 -0
- package/types/lib/stages/postgen/auditBom.d.ts.map +1 -0
- package/types/lib/stages/postgen/postgen.d.ts +8 -1
- package/types/lib/stages/postgen/postgen.d.ts.map +1 -1
- package/types/lib/stages/postgen/ruleEngine.d.ts +18 -0
- package/types/lib/stages/postgen/ruleEngine.d.ts.map +1 -0
- package/types/lib/stages/pregen/envAudit.d.ts +8 -0
- package/types/lib/stages/pregen/envAudit.d.ts.map +1 -0
- package/types/lib/stages/pregen/pregen.d.ts.map +1 -1
- package/types/lib/{helpers/validator.d.ts → validator/bomValidator.d.ts} +1 -1
- package/types/lib/validator/bomValidator.d.ts.map +1 -0
- package/types/lib/validator/complianceEngine.d.ts +66 -0
- package/types/lib/validator/complianceEngine.d.ts.map +1 -0
- package/types/lib/validator/complianceRules.d.ts +70 -0
- package/types/lib/validator/complianceRules.d.ts.map +1 -0
- package/types/lib/validator/index.d.ts +70 -0
- package/types/lib/validator/index.d.ts.map +1 -0
- package/types/lib/validator/reporters/annotations.d.ts +31 -0
- package/types/lib/validator/reporters/annotations.d.ts.map +1 -0
- package/types/lib/validator/reporters/console.d.ts +30 -0
- package/types/lib/validator/reporters/console.d.ts.map +1 -0
- package/types/lib/validator/reporters/index.d.ts +21 -0
- package/types/lib/validator/reporters/index.d.ts.map +1 -0
- package/types/lib/validator/reporters/json.d.ts +11 -0
- package/types/lib/validator/reporters/json.d.ts.map +1 -0
- package/types/lib/validator/reporters/sarif.d.ts +16 -0
- package/types/lib/validator/reporters/sarif.d.ts.map +1 -0
- package/lib/helpers/db.js +0 -162
- package/lib/stages/pregen/env-audit.js +0 -34
- package/lib/stages/pregen/env-audit.poku.js +0 -290
- package/types/helpers/db.d.ts +0 -35
- package/types/helpers/db.d.ts.map +0 -1
- package/types/lib/helpers/db.d.ts +0 -35
- package/types/lib/helpers/db.d.ts.map +0 -1
- package/types/lib/helpers/validator.d.ts.map +0 -1
- package/types/lib/stages/pregen/env-audit.d.ts +0 -2
- package/types/lib/stages/pregen/env-audit.d.ts.map +0 -1
- package/types/managers/binary.d.ts +0 -37
- package/types/managers/binary.d.ts.map +0 -1
- package/types/managers/docker.d.ts +0 -56
- package/types/managers/docker.d.ts.map +0 -1
- package/types/managers/oci.d.ts +0 -2
- package/types/managers/oci.d.ts.map +0 -1
- package/types/managers/piptree.d.ts +0 -2
- package/types/managers/piptree.d.ts.map +0 -1
- package/types/server/server.d.ts +0 -34
- package/types/server/server.d.ts.map +0 -1
- package/types/stages/postgen/annotator.d.ts +0 -27
- package/types/stages/postgen/annotator.d.ts.map +0 -1
- package/types/stages/postgen/postgen.d.ts +0 -51
- package/types/stages/postgen/postgen.d.ts.map +0 -1
- package/types/stages/pregen/pregen.d.ts +0 -59
- package/types/stages/pregen/pregen.d.ts.map +0 -1
|
@@ -13,10 +13,44 @@ export function safeExistsSync(filePath: string): any;
|
|
|
13
13
|
* @Boolean True if the path exists. False otherwise
|
|
14
14
|
*/
|
|
15
15
|
export function safeMkdirSync(filePath: string, options: Options): any;
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
/**
|
|
17
|
+
* Safe wrapper around spawnSync that enforces permission checks, injects default
|
|
18
|
+
* options (maxBuffer, encoding, timeout), warns about unsafe Python and pip/uv
|
|
19
|
+
* invocations, and records every executed command in the commandsExecuted set.
|
|
20
|
+
*
|
|
21
|
+
* @param {string} command The executable to spawn
|
|
22
|
+
* @param {string[]} args Arguments to pass to the command
|
|
23
|
+
* @param {Object} options Options forwarded to spawnSync (e.g. cwd, env, shell)
|
|
24
|
+
* @returns {Object} spawnSync result object with status, stdout, stderr, and error fields
|
|
25
|
+
*/
|
|
26
|
+
export function safeSpawnSync(command: string, args: string[], options: Object): Object;
|
|
27
|
+
/**
|
|
28
|
+
* Determines whether license information should be fetched from remote sources,
|
|
29
|
+
* based on the FETCH_LICENSE environment variable.
|
|
30
|
+
*
|
|
31
|
+
* @returns {boolean} True if the FETCH_LICENSE env var is set to "true" or "1"
|
|
32
|
+
*/
|
|
33
|
+
export function shouldFetchLicense(): boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Determines whether VCS (version control system) information should be fetched
|
|
36
|
+
* for Go packages, based on the GO_FETCH_VCS environment variable.
|
|
37
|
+
*
|
|
38
|
+
* @returns {boolean} True if the GO_FETCH_VCS env var is set to "true" or "1"
|
|
39
|
+
*/
|
|
40
|
+
export function shouldFetchVCS(): boolean;
|
|
41
|
+
/**
|
|
42
|
+
* Returns the Java executable command to use, resolved in priority order:
|
|
43
|
+
* JAVA_CMD env var > JAVA_HOME/bin/java > "java".
|
|
44
|
+
*
|
|
45
|
+
* @returns {string} Path or name of the Java executable
|
|
46
|
+
*/
|
|
19
47
|
export function getJavaCommand(): string;
|
|
48
|
+
/**
|
|
49
|
+
* Returns the Python executable command to use, resolved in priority order:
|
|
50
|
+
* PYTHON_CMD env var > CONDA_PYTHON_EXE env var > "python".
|
|
51
|
+
*
|
|
52
|
+
* @returns {string} Path or name of the Python executable
|
|
53
|
+
*/
|
|
20
54
|
export function getPythonCommand(): string;
|
|
21
55
|
/**
|
|
22
56
|
* Method to check if a given feature flag is enabled.
|
|
@@ -120,7 +154,14 @@ export function addLicenseText(pkg: any, l: any, licenseContent: any): void;
|
|
|
120
154
|
export function readLicenseText(licenseFilepath: any, licenseContentType: any): {
|
|
121
155
|
content: any;
|
|
122
156
|
} | null;
|
|
123
|
-
|
|
157
|
+
/**
|
|
158
|
+
* Fetches license information for a list of Swift packages by querying the
|
|
159
|
+
* GitHub repository license API for packages hosted on github.com.
|
|
160
|
+
*
|
|
161
|
+
* @param {Object[]} pkgList List of Swift package objects with optional repository.url fields
|
|
162
|
+
* @returns {Promise<Object[]>} Resolved list of package objects, each augmented with a license field where available
|
|
163
|
+
*/
|
|
164
|
+
export function getSwiftPackageMetadata(pkgList: Object[]): Promise<Object[]>;
|
|
124
165
|
/**
|
|
125
166
|
* Method to retrieve metadata for npm packages by querying npmjs
|
|
126
167
|
*
|
|
@@ -132,8 +173,9 @@ export function getNpmMetadata(pkgList: any[]): Promise<any[]>;
|
|
|
132
173
|
*
|
|
133
174
|
* @param {string} pkgJsonFile package.json file
|
|
134
175
|
* @param {boolean} simple Return a simpler representation of the component by skipping extended attributes and license fetch.
|
|
176
|
+
* @param {boolean} securityProps Collect security-related properties
|
|
135
177
|
*/
|
|
136
|
-
export function parsePkgJson(pkgJsonFile: string, simple?: boolean): Promise<any[]>;
|
|
178
|
+
export function parsePkgJson(pkgJsonFile: string, simple?: boolean, securityProps?: boolean): Promise<any[]>;
|
|
137
179
|
/**
|
|
138
180
|
* Parse nodejs package lock file
|
|
139
181
|
*
|
|
@@ -188,11 +230,14 @@ export function parsePnpmWorkspace(workspaceFile: string): object;
|
|
|
188
230
|
* @returns {string} Encoded PURL string
|
|
189
231
|
*/
|
|
190
232
|
export function createNpmWorkspacePurl(packageName: string, version: string): string;
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
}
|
|
233
|
+
/**
|
|
234
|
+
* Parses the workspaces field from a package.json file and returns the list of
|
|
235
|
+
* workspace glob patterns. Handles both array and object (with packages key) formats.
|
|
236
|
+
*
|
|
237
|
+
* @param {string} packageJsonFile Path to the package.json file to parse
|
|
238
|
+
* @returns {Object} Object with a packages array of workspace glob patterns, or an empty object on error
|
|
239
|
+
*/
|
|
240
|
+
export function parseYarnWorkspace(packageJsonFile: string): Object;
|
|
196
241
|
/**
|
|
197
242
|
* Helper function to find a package path in pnpm node_modules structure
|
|
198
243
|
*
|
|
@@ -304,8 +349,17 @@ export function parseCljDep(rawOutput: string): any[];
|
|
|
304
349
|
* Parse lein dependency tree output
|
|
305
350
|
* @param {string} rawOutput Raw string output
|
|
306
351
|
*/
|
|
307
|
-
export function parseLeinDep(rawOutput: string):
|
|
308
|
-
|
|
352
|
+
export function parseLeinDep(rawOutput: string): Object[];
|
|
353
|
+
/**
|
|
354
|
+
* Recursively walks a parsed EDN map node produced by the Leiningen dependency
|
|
355
|
+
* tree and collects unique dependency entries into the deps array.
|
|
356
|
+
*
|
|
357
|
+
* @param {Object} node Parsed EDN node (expected to have a "map" property)
|
|
358
|
+
* @param {Object} keys_cache Cache object used to deduplicate entries by group-name-version key
|
|
359
|
+
* @param {Object[]} deps Accumulator array of dependency objects with group, name, and version fields
|
|
360
|
+
* @returns {Object[]} The populated deps array
|
|
361
|
+
*/
|
|
362
|
+
export function parseLeinMap(node: Object, keys_cache: Object, deps: Object[]): Object[];
|
|
309
363
|
/**
|
|
310
364
|
* Parse gradle projects output
|
|
311
365
|
*
|
|
@@ -617,15 +671,17 @@ export function getRepoLicense(repoUrl: string, repoMetadata: Object): Promise<s
|
|
|
617
671
|
* @param {Object} repoMetadata Repo metadata
|
|
618
672
|
*/
|
|
619
673
|
export function getGoPkgLicense(repoMetadata: Object): Promise<any>;
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
}
|
|
674
|
+
/**
|
|
675
|
+
* Builds a Go package component object containing purl, bom-ref, integrity hash,
|
|
676
|
+
* and optionally license and VCS external reference information.
|
|
677
|
+
*
|
|
678
|
+
* @param {string} group Package group (module path prefix, may be empty)
|
|
679
|
+
* @param {string} name Package name (full module path when group is empty)
|
|
680
|
+
* @param {string} version Package version string
|
|
681
|
+
* @param {string} hash Integrity hash (e.g. "sha256-…"), used as _integrity
|
|
682
|
+
* @returns {Promise<Object>} Component object ready for inclusion in a BOM package list
|
|
683
|
+
*/
|
|
684
|
+
export function getGoPkgComponent(group: string, name: string, version: string, hash: string): Promise<Object>;
|
|
629
685
|
/**
|
|
630
686
|
* Method to parse go.mod files
|
|
631
687
|
*
|
|
@@ -635,7 +691,16 @@ export function getGoPkgComponent(group: any, name: any, version: any, hash: any
|
|
|
635
691
|
* @returns {Object} Object containing parent component, rootList and packages list
|
|
636
692
|
*/
|
|
637
693
|
export function parseGoModData(goModData: string, gosumMap: Object): Object;
|
|
638
|
-
|
|
694
|
+
/**
|
|
695
|
+
* Parses a Go modules text file (e.g. vendor/modules.txt) and returns a list of
|
|
696
|
+
* Go package components. Cross-references the go.sum map for integrity hashes and
|
|
697
|
+
* sets scope and confidence based on hash availability.
|
|
698
|
+
*
|
|
699
|
+
* @param {string} txtFile Path to the modules.txt file
|
|
700
|
+
* @param {Object} gosumMap Map of "module@version" keys to sha256 hash values from go.sum
|
|
701
|
+
* @returns {Promise<Object[]>} List of Go package component objects with evidence
|
|
702
|
+
*/
|
|
703
|
+
export function parseGoModulesTxt(txtFile: string, gosumMap: Object): Promise<Object[]>;
|
|
639
704
|
/**
|
|
640
705
|
* Parse go list output
|
|
641
706
|
*
|
|
@@ -645,15 +710,7 @@ export function parseGoModulesTxt(txtFile: any, gosumMap: any): Promise<any[]>;
|
|
|
645
710
|
*/
|
|
646
711
|
export function parseGoListDep(rawOutput: string, gosumMap: Object): Promise<{
|
|
647
712
|
parentComponent: {};
|
|
648
|
-
pkgList:
|
|
649
|
-
group: any;
|
|
650
|
-
name: any;
|
|
651
|
-
version: any;
|
|
652
|
-
_integrity: any;
|
|
653
|
-
license: any;
|
|
654
|
-
purl: string;
|
|
655
|
-
"bom-ref": string;
|
|
656
|
-
}[];
|
|
713
|
+
pkgList: Object[];
|
|
657
714
|
}>;
|
|
658
715
|
/**
|
|
659
716
|
* Parse go mod graph
|
|
@@ -688,8 +745,23 @@ export function parseGoModWhy(rawOutput: string): string | undefined;
|
|
|
688
745
|
* @returns package list
|
|
689
746
|
*/
|
|
690
747
|
export function parseGosumData(gosumData: string): Promise<any[]>;
|
|
691
|
-
|
|
692
|
-
|
|
748
|
+
/**
|
|
749
|
+
* Parses the contents of a Gopkg.lock or Gopkg.toml file (dep tool format) and
|
|
750
|
+
* returns a list of Go package components. Optionally fetches license information
|
|
751
|
+
* for each package when FETCH_LICENSE is enabled.
|
|
752
|
+
*
|
|
753
|
+
* @param {string} gopkgData Raw string contents of the Gopkg lock/toml file
|
|
754
|
+
* @returns {Promise<Object[]>} List of Go package component objects
|
|
755
|
+
*/
|
|
756
|
+
export function parseGopkgData(gopkgData: string): Promise<Object[]>;
|
|
757
|
+
/**
|
|
758
|
+
* Parses the output of `go version -m` (build info) and returns a list of Go
|
|
759
|
+
* package components for each "dep" line, including name, version, and integrity hash.
|
|
760
|
+
*
|
|
761
|
+
* @param {string} buildInfoData Raw string output from `go version -m`
|
|
762
|
+
* @returns {Promise<Object[]>} List of Go package component objects
|
|
763
|
+
*/
|
|
764
|
+
export function parseGoVersionData(buildInfoData: string): Promise<Object[]>;
|
|
693
765
|
/**
|
|
694
766
|
* Method to query rubygems api for gems details
|
|
695
767
|
*
|
|
@@ -776,8 +848,23 @@ export function parseCargoTomlData(cargoTomlFile: string, simple?: boolean, pkgF
|
|
|
776
848
|
* @returns {Array} A list of the project's components as described by the Cargo.lock-file.
|
|
777
849
|
*/
|
|
778
850
|
export function parseCargoData(cargoLockFile: string, simple?: boolean, pkgFilesMap?: Object): any[];
|
|
779
|
-
|
|
780
|
-
|
|
851
|
+
/**
|
|
852
|
+
* Parses a Cargo.lock file's TOML data and returns a flat dependency graph as an
|
|
853
|
+
* array of objects mapping each package purl to the purls it directly depends on.
|
|
854
|
+
*
|
|
855
|
+
* @param {string} cargoLockData Raw TOML string contents of a Cargo.lock file
|
|
856
|
+
* @returns {Object[]} Array of dependency relationship objects with ref and dependsOn fields
|
|
857
|
+
*/
|
|
858
|
+
export function parseCargoDependencyData(cargoLockData: string): Object[];
|
|
859
|
+
/**
|
|
860
|
+
* Parses tab-separated cargo-auditable binary metadata output and returns a list
|
|
861
|
+
* of Rust package components. Optionally fetches crates.io metadata when
|
|
862
|
+
* FETCH_LICENSE is enabled.
|
|
863
|
+
*
|
|
864
|
+
* @param {string} cargoData Tab-separated string output from cargo-auditable or similar tool
|
|
865
|
+
* @returns {Promise<Object[]>} List of Rust package component objects with group, name, and version
|
|
866
|
+
*/
|
|
867
|
+
export function parseCargoAuditableData(cargoData: string): Promise<Object[]>;
|
|
781
868
|
/**
|
|
782
869
|
* Method to parse pubspec.lock files.
|
|
783
870
|
*
|
|
@@ -787,32 +874,172 @@ export function parseCargoAuditableData(cargoData: any): Promise<any[]>;
|
|
|
787
874
|
* @returns {Object}
|
|
788
875
|
*/
|
|
789
876
|
export function parsePubLockData(pubLockData: any, lockFile: any): Object;
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
export function
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
877
|
+
/**
|
|
878
|
+
* Parses a Dart pub package's pubspec.yaml content and returns a list containing
|
|
879
|
+
* a single component object with name, description, version, homepage, and purl.
|
|
880
|
+
*
|
|
881
|
+
* @param {string} pubYamlData Raw YAML string contents of a pubspec.yaml file
|
|
882
|
+
* @returns {Object[]} List containing a single Dart package component object
|
|
883
|
+
*/
|
|
884
|
+
export function parsePubYamlData(pubYamlData: string): Object[];
|
|
885
|
+
/**
|
|
886
|
+
* Parses Helm chart YAML data (Chart.yaml or repository index.yaml) and returns
|
|
887
|
+
* a list of Helm chart component objects including the chart itself and any
|
|
888
|
+
* declared dependencies or index entries.
|
|
889
|
+
*
|
|
890
|
+
* @param {string} helmData Raw YAML string contents of a Helm Chart.yaml or index.yaml file
|
|
891
|
+
* @returns {Object[]} List of Helm chart component objects with name, version, and optional homepage/repository
|
|
892
|
+
*/
|
|
893
|
+
export function parseHelmYamlData(helmData: string): Object[];
|
|
894
|
+
/**
|
|
895
|
+
* Recursively walks a parsed YAML/JSON object structure to find container image
|
|
896
|
+
* references stored under common keys (image, repository, dockerImage, etc.) and
|
|
897
|
+
* appends discovered image and service entries to pkgList while tracking seen
|
|
898
|
+
* images in imgList to avoid duplicates.
|
|
899
|
+
*
|
|
900
|
+
* @param {Object|Array|string} keyValueObj The object, array, or string node to inspect
|
|
901
|
+
* @param {Object[]} pkgList Accumulator array that receives {image} and {service} entries
|
|
902
|
+
* @param {string[]} imgList Accumulator array of image name strings already seen
|
|
903
|
+
* @returns {string[]} The updated imgList
|
|
904
|
+
*/
|
|
905
|
+
export function recurseImageNameLookup(keyValueObj: Object | any[] | string, pkgList: Object[], imgList: string[]): string[];
|
|
906
|
+
/**
|
|
907
|
+
* Parses the contents of a Dockerfile or Containerfile and returns a list of
|
|
908
|
+
* base image objects referenced by FROM instructions, substituting ARG default
|
|
909
|
+
* values where possible and skipping multi-stage build alias references.
|
|
910
|
+
*
|
|
911
|
+
* @param {string} fileContents Raw string contents of the Dockerfile/Containerfile
|
|
912
|
+
* @returns {Object[]} Array of objects with an image property for each unique base image
|
|
913
|
+
*/
|
|
914
|
+
export function parseContainerFile(fileContents: string): Object[];
|
|
915
|
+
/**
|
|
916
|
+
* Parses a Bitbucket Pipelines YAML file and extracts all Docker image references
|
|
917
|
+
* used as build environments and pipe references (docker:// pipes are normalized).
|
|
918
|
+
*
|
|
919
|
+
* @param {string} fileContents Raw string contents of the bitbucket-pipelines.yml file
|
|
920
|
+
* @returns {Object[]} Array of objects with an image property for each referenced image or pipe
|
|
921
|
+
*/
|
|
922
|
+
export function parseBitbucketPipelinesFile(fileContents: string): Object[];
|
|
923
|
+
/**
|
|
924
|
+
* Parses container specification data such as Docker Compose files, Kubernetes
|
|
925
|
+
* manifests, Tekton tasks, Skaffold configs, or Kustomize overlays (YAML, possibly
|
|
926
|
+
* multi-document) and returns a list of image, service, and OCI spec entries.
|
|
927
|
+
*
|
|
928
|
+
* @param {string} dcData Raw YAML string contents of the container spec file
|
|
929
|
+
* @returns {Object[]} Array of objects with image, service, or ociSpec properties
|
|
930
|
+
*/
|
|
931
|
+
export function parseContainerSpecData(dcData: string): Object[];
|
|
932
|
+
/**
|
|
933
|
+
* Identifies the data flow direction of a Privado processing object based on its
|
|
934
|
+
* sinkId value: "write" sinks map to "inbound", "read" sinks to "outbound", and
|
|
935
|
+
* HTTP/gRPC sinks to "bi-directional".
|
|
936
|
+
*
|
|
937
|
+
* @param {Object} processingObj Privado processing object, expected to have a sinkId property
|
|
938
|
+
* @returns {string} Flow direction string: "inbound", "outbound", "bi-directional", or "unknown"
|
|
939
|
+
*/
|
|
940
|
+
export function identifyFlow(processingObj: Object): string;
|
|
941
|
+
/**
|
|
942
|
+
* Parses a Privado data flow JSON file and returns a list of service objects
|
|
943
|
+
* enriched with data classifications, endpoints, trust-boundary flag, violations,
|
|
944
|
+
* and git metadata properties extracted from the scan result.
|
|
945
|
+
*
|
|
946
|
+
* @param {string} f Path to the Privado scan result JSON file
|
|
947
|
+
* @returns {Object[]} List of service component objects suitable for a SaaSBOM
|
|
948
|
+
*/
|
|
949
|
+
export function parsePrivadoFile(f: string): Object[];
|
|
950
|
+
/**
|
|
951
|
+
* Parses an OpenAPI specification (JSON or YAML string) and returns a list
|
|
952
|
+
* containing a single service object with name, version, endpoints, and
|
|
953
|
+
* authentication flag derived from the spec's info, servers, paths, and
|
|
954
|
+
* securitySchemes sections.
|
|
955
|
+
*
|
|
956
|
+
* @param {string} oaData Raw JSON or YAML string contents of an OpenAPI specification
|
|
957
|
+
* @returns {Object[]} List containing a single service component object
|
|
958
|
+
*/
|
|
959
|
+
export function parseOpenapiSpecData(oaData: string): Object[];
|
|
960
|
+
/**
|
|
961
|
+
* Parses Haskell Cabal freeze file content and extracts package name and version
|
|
962
|
+
* pairs from constraint lines (lines containing " ==").
|
|
963
|
+
*
|
|
964
|
+
* @param {string} cabalData Raw string contents of a Cabal freeze file
|
|
965
|
+
* @returns {Object[]} List of package objects with name and version fields
|
|
966
|
+
*/
|
|
967
|
+
export function parseCabalData(cabalData: string): Object[];
|
|
968
|
+
/**
|
|
969
|
+
* Parses an Elixir mix.lock file and extracts Hex package name and version pairs
|
|
970
|
+
* from lines containing ":hex".
|
|
971
|
+
*
|
|
972
|
+
* @param {string} mixData Raw string contents of a mix.lock file
|
|
973
|
+
* @returns {Object[]} List of package objects with name and version fields
|
|
974
|
+
*/
|
|
975
|
+
export function parseMixLockData(mixData: string): Object[];
|
|
976
|
+
/**
|
|
977
|
+
* Parses a GitHub Actions workflow YAML file and returns a list of action
|
|
978
|
+
* components for each step that uses an external action (steps with a "uses"
|
|
979
|
+
* field). Each component captures the action name, group, version/commit SHA,
|
|
980
|
+
* version pinning type, job context (runner, permissions, environment), and
|
|
981
|
+
* workflow-level metadata (triggers, concurrency, write permissions).
|
|
982
|
+
*
|
|
983
|
+
* @param {string} f Path to the GitHub Actions workflow YAML file
|
|
984
|
+
* @returns {Object[]} List of action component objects with purl, properties, and evidence
|
|
985
|
+
*/
|
|
986
|
+
export function parseGitHubWorkflowData(f: string): Object[];
|
|
987
|
+
/**
|
|
988
|
+
* Parse Google Cloud Build YAML data and extract container image steps as packages.
|
|
989
|
+
*
|
|
990
|
+
* @param {string} cbwData Raw YAML string of a Cloud Build configuration file
|
|
991
|
+
* @returns {Object[]} Array of package objects parsed from the build steps
|
|
992
|
+
*/
|
|
993
|
+
export function parseCloudBuildData(cbwData: string): Object[];
|
|
994
|
+
/**
|
|
995
|
+
* Map a Conan package reference string to a PackageURL string, name, and version.
|
|
996
|
+
*
|
|
997
|
+
* Parses a full Conan package reference of the form
|
|
998
|
+
* `name/version@user/channel#recipe_revision:package_id#package_revision`
|
|
999
|
+
* and returns the equivalent purl string together with the extracted name and version.
|
|
1000
|
+
*
|
|
1001
|
+
* @param {string} conanPkgRef Conan package reference string
|
|
1002
|
+
* @returns {Array} Tuple of [purlString, name, version], or [null, null, null] on parse failure
|
|
1003
|
+
*/
|
|
1004
|
+
export function mapConanPkgRefToPurlStringAndNameAndVersion(conanPkgRef: string): any[];
|
|
1005
|
+
/**
|
|
1006
|
+
* Parse Conan lock file data (conan.lock) and return the package list, dependency map,
|
|
1007
|
+
* and parent component dependencies.
|
|
1008
|
+
*
|
|
1009
|
+
* Supports both the legacy `graph_lock.nodes` format (Conan 1.x) and the newer
|
|
1010
|
+
* `requires` format (Conan 2.x).
|
|
1011
|
+
*
|
|
1012
|
+
* @param {string} conanLockData Raw JSON string of the Conan lock file
|
|
1013
|
+
* @returns {{ pkgList: Object[], dependencies: Object, parentComponentDependencies: string[] }}
|
|
1014
|
+
*/
|
|
1015
|
+
export function parseConanLockData(conanLockData: string): {
|
|
1016
|
+
pkgList: Object[];
|
|
1017
|
+
dependencies: Object;
|
|
1018
|
+
parentComponentDependencies: string[];
|
|
812
1019
|
};
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
1020
|
+
/**
|
|
1021
|
+
* Parse a Conan conanfile.txt and extract required and optional packages.
|
|
1022
|
+
*
|
|
1023
|
+
* @param {string} conanData Raw text contents of a conanfile.txt
|
|
1024
|
+
* @returns {Object[]} Array of package objects with purl, name, version, and scope
|
|
1025
|
+
*/
|
|
1026
|
+
export function parseConanData(conanData: string): Object[];
|
|
1027
|
+
/**
|
|
1028
|
+
* Parse Leiningen project.clj data and extract dependency packages.
|
|
1029
|
+
*
|
|
1030
|
+
* @param {string} leinData Raw text contents of a Leiningen project.clj file
|
|
1031
|
+
* @returns {Object[]} Array of package objects with group, name, and version
|
|
1032
|
+
*/
|
|
1033
|
+
export function parseLeiningenData(leinData: string): Object[];
|
|
1034
|
+
/**
|
|
1035
|
+
* Parse EDN (Extensible Data Notation) deps.edn data and extract dependency packages.
|
|
1036
|
+
*
|
|
1037
|
+
* Handles Clojure deps.edn files, extracting packages listed under the `:deps` key.
|
|
1038
|
+
*
|
|
1039
|
+
* @param {string} rawEdnData Raw EDN text contents of a deps.edn file
|
|
1040
|
+
* @returns {Object[]} Array of package objects with group, name, and version
|
|
1041
|
+
*/
|
|
1042
|
+
export function parseEdnData(rawEdnData: string): Object[];
|
|
816
1043
|
/**
|
|
817
1044
|
* Method to parse .nupkg files
|
|
818
1045
|
*
|
|
@@ -842,7 +1069,14 @@ export function parseFlakeLock(flakeLockFile: string): Object;
|
|
|
842
1069
|
* @returns {Object} Object containing package list and dependencies
|
|
843
1070
|
*/
|
|
844
1071
|
export function parseNuspecData(nupkgFile: string, nuspecData: string): Object;
|
|
845
|
-
|
|
1072
|
+
/**
|
|
1073
|
+
* Parse a C# packages.config XML file and return a list of NuGet package components.
|
|
1074
|
+
*
|
|
1075
|
+
* @param {string} pkgData Raw XML string of a packages.config file
|
|
1076
|
+
* @param {string} pkgFile Path to the packages.config file, used for evidence properties
|
|
1077
|
+
* @returns {Object[]} Array of NuGet package objects with purl, name, and version
|
|
1078
|
+
*/
|
|
1079
|
+
export function parseCsPkgData(pkgData: string, pkgFile: string): Object[];
|
|
846
1080
|
/**
|
|
847
1081
|
* Method to find all text nodes in PropertyGroup elements in .props files.
|
|
848
1082
|
*
|
|
@@ -861,18 +1095,45 @@ export function getPropertyGroupTextNodes(propsFiles: string): Object;
|
|
|
861
1095
|
* @returns {Object} Containing parent component, package, and dependencies
|
|
862
1096
|
*/
|
|
863
1097
|
export function parseCsProjData(csProjData: string, projFile: string, pkgNameVersions?: Object, msbuildInstalled?: boolean, pkgVersionLabelCandidates?: {}): Object;
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
1098
|
+
/**
|
|
1099
|
+
* Parse a .NET project.assets.json file and return the package list and dependency tree.
|
|
1100
|
+
*
|
|
1101
|
+
* Extracts NuGet packages and their transitive dependency relationships from the
|
|
1102
|
+
* `libraries` and `targets` sections of a project.assets.json file produced by
|
|
1103
|
+
* the .NET restore process.
|
|
1104
|
+
*
|
|
1105
|
+
* @param {string} csProjData Raw JSON string of the project.assets.json file
|
|
1106
|
+
* @param {string} assetsJsonFile Path to the project.assets.json file, used for evidence properties
|
|
1107
|
+
* @returns {{ pkgList: Object[], dependenciesList: Object[] }}
|
|
1108
|
+
*/
|
|
1109
|
+
export function parseCsProjAssetsData(csProjData: string, assetsJsonFile: string): {
|
|
1110
|
+
pkgList: Object[];
|
|
1111
|
+
dependenciesList: Object[];
|
|
867
1112
|
};
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
1113
|
+
/**
|
|
1114
|
+
* Parse a .NET packages.lock.json file and return the package list, dependency tree,
|
|
1115
|
+
* and list of direct/root dependencies.
|
|
1116
|
+
*
|
|
1117
|
+
* @param {string} csLockData Raw JSON string of the packages.lock.json file
|
|
1118
|
+
* @param {string} pkgLockFile Path to the packages.lock.json file, used for evidence properties
|
|
1119
|
+
* @returns {{ pkgList: Object[], dependenciesList: Object[], rootList: Object[] }}
|
|
1120
|
+
*/
|
|
1121
|
+
export function parseCsPkgLockData(csLockData: string, pkgLockFile: string): {
|
|
1122
|
+
pkgList: Object[];
|
|
1123
|
+
dependenciesList: Object[];
|
|
1124
|
+
rootList: Object[];
|
|
872
1125
|
};
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
1126
|
+
/**
|
|
1127
|
+
* Parse a Paket dependency manager lock file (paket.lock) and return the package list
|
|
1128
|
+
* and dependency tree.
|
|
1129
|
+
*
|
|
1130
|
+
* @param {string} paketLockData Raw text contents of the paket.lock file
|
|
1131
|
+
* @param {string} pkgLockFile Path to the paket.lock file, used for evidence properties
|
|
1132
|
+
* @returns {{ pkgList: Object[], dependenciesList: Object[] }}
|
|
1133
|
+
*/
|
|
1134
|
+
export function parsePaketLockData(paketLockData: string, pkgLockFile: string): {
|
|
1135
|
+
pkgList: Object[];
|
|
1136
|
+
dependenciesList: Object[];
|
|
876
1137
|
};
|
|
877
1138
|
/**
|
|
878
1139
|
* Parse composer.json file
|
|
@@ -946,12 +1207,18 @@ export function parseComposerLock(pkgLockFile: string, rootRequires: array): nev
|
|
|
946
1207
|
};
|
|
947
1208
|
}[];
|
|
948
1209
|
};
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
1210
|
+
/**
|
|
1211
|
+
* Parse an sbt dependency tree output file and return the package list and dependency tree.
|
|
1212
|
+
*
|
|
1213
|
+
* Reads a file produced by the sbt `dependencyTree` command and extracts Maven artifact
|
|
1214
|
+
* coordinates, building a hierarchical dependency graph. Evicted packages and ranges are ignored.
|
|
1215
|
+
*
|
|
1216
|
+
* @param {string} sbtTreeFile Path to the sbt dependency tree output file
|
|
1217
|
+
* @returns {{ pkgList: Object[], dependenciesList: Object[] }}
|
|
1218
|
+
*/
|
|
1219
|
+
export function parseSbtTree(sbtTreeFile: string): {
|
|
1220
|
+
pkgList: Object[];
|
|
1221
|
+
dependenciesList: Object[];
|
|
955
1222
|
};
|
|
956
1223
|
/**
|
|
957
1224
|
* Parse sbt lock file
|
|
@@ -1034,7 +1301,18 @@ export function convertOSQueryResults(queryCategory: string, queryObj: Object, r
|
|
|
1034
1301
|
scope: any;
|
|
1035
1302
|
type: any;
|
|
1036
1303
|
}[];
|
|
1037
|
-
|
|
1304
|
+
/**
|
|
1305
|
+
* Create a PackageURL object from a repository URL string, package type, and version.
|
|
1306
|
+
*
|
|
1307
|
+
* Supports HTTPS URLs, SSH `git@` URLs, Bitbucket SSH URLs, and local paths.
|
|
1308
|
+
* Extracts the namespace (host + path prefix) and repository name from the URL.
|
|
1309
|
+
*
|
|
1310
|
+
* @param {string} type PackageURL type (e.g. `"swift"`, `"generic"`)
|
|
1311
|
+
* @param {string} repoUrl Repository URL string
|
|
1312
|
+
* @param {string} version Package version
|
|
1313
|
+
* @returns {PackageURL|undefined} PackageURL object, or undefined for unsupported URL formats
|
|
1314
|
+
*/
|
|
1315
|
+
export function purlFromUrlString(type: string, repoUrl: string, version: string): PackageURL | undefined;
|
|
1038
1316
|
/**
|
|
1039
1317
|
* Parse swift dependency tree output json object
|
|
1040
1318
|
*
|
|
@@ -1093,7 +1371,21 @@ export function parseSwiftResolved(resolvedFile: string): {
|
|
|
1093
1371
|
* @param {boolean} includeCacheDir Include maven and gradle cache directories
|
|
1094
1372
|
*/
|
|
1095
1373
|
export function collectMvnDependencies(mavenCmd: string, basePath: string, cleanup?: boolean, includeCacheDir?: boolean): Promise<{}>;
|
|
1096
|
-
|
|
1374
|
+
/**
|
|
1375
|
+
* Collect Gradle project dependencies by scanning the Gradle cache directory for JAR files
|
|
1376
|
+
* and their associated POM files.
|
|
1377
|
+
*
|
|
1378
|
+
* Uses the `GRADLE_CACHE_DIR` or `GRADLE_USER_HOME` environment variables to locate the
|
|
1379
|
+
* Gradle files-2.1 cache, then delegates to {@link collectJarNS} to extract namespace
|
|
1380
|
+
* and purl information from those JARs.
|
|
1381
|
+
*
|
|
1382
|
+
* @param {string} _gradleCmd Gradle command (unused; reserved for future use)
|
|
1383
|
+
* @param {string} _basePath Base project path (unused; reserved for future use)
|
|
1384
|
+
* @param {boolean} _cleanup Whether to clean up temporary files (unused; reserved for future use)
|
|
1385
|
+
* @param {boolean} _includeCacheDir Whether to include cache directory (unused; reserved for future use)
|
|
1386
|
+
* @returns {Promise<Object>} JAR namespace mapping object returned by collectJarNS
|
|
1387
|
+
*/
|
|
1388
|
+
export function collectGradleDependencies(_gradleCmd: string, _basePath: string, _cleanup?: boolean, _includeCacheDir?: boolean): Promise<Object>;
|
|
1097
1389
|
/**
|
|
1098
1390
|
* Method to collect class names from all jars in a directory
|
|
1099
1391
|
*
|
|
@@ -1103,30 +1395,17 @@ export function collectGradleDependencies(_gradleCmd: any, _basePath: any, _clea
|
|
|
1103
1395
|
* @return object containing jar name and class list
|
|
1104
1396
|
*/
|
|
1105
1397
|
export function collectJarNS(jarPath: string, pomPathMap?: object): Promise<{}>;
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
confidence: number;
|
|
1118
|
-
methods: {
|
|
1119
|
-
technique: string;
|
|
1120
|
-
confidence: number;
|
|
1121
|
-
value: any;
|
|
1122
|
-
}[];
|
|
1123
|
-
};
|
|
1124
|
-
};
|
|
1125
|
-
properties: {
|
|
1126
|
-
name: string;
|
|
1127
|
-
value: any;
|
|
1128
|
-
}[];
|
|
1129
|
-
}[]>;
|
|
1398
|
+
/**
|
|
1399
|
+
* Convert a JAR namespace mapping (produced by {@link collectJarNS}) into an array
|
|
1400
|
+
* of CycloneDX package component objects.
|
|
1401
|
+
*
|
|
1402
|
+
* Each entry in the mapping is resolved to a component with name, group, version,
|
|
1403
|
+
* purl, hashes, namespace properties, and source file evidence.
|
|
1404
|
+
*
|
|
1405
|
+
* @param {Object} jarNSMapping Map of purl string to `{ jarFile, pom, namespaces, hashes }`
|
|
1406
|
+
* @returns {Promise<Object[]>} Array of component objects derived from the JAR mapping
|
|
1407
|
+
*/
|
|
1408
|
+
export function convertJarNSToPackages(jarNSMapping: Object): Promise<Object[]>;
|
|
1130
1409
|
/**
|
|
1131
1410
|
* Deprecated function to parse pom.xml. Use parsePom instead.
|
|
1132
1411
|
*
|
|
@@ -1135,9 +1414,28 @@ export function convertJarNSToPackages(jarNSMapping: any): Promise<{
|
|
|
1135
1414
|
* @returns {Object} Parent component data
|
|
1136
1415
|
*/
|
|
1137
1416
|
export function parsePomXml(pomXmlData: any): Object;
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1417
|
+
/**
|
|
1418
|
+
* Parse a JAR MANIFEST.MF file and return its key-value pairs as an object.
|
|
1419
|
+
*
|
|
1420
|
+
* @param {string} jarMetadata Raw text contents of a MANIFEST.MF file
|
|
1421
|
+
* @returns {Object} Key-value pairs extracted from the manifest
|
|
1422
|
+
*/
|
|
1423
|
+
export function parseJarManifest(jarMetadata: string): Object;
|
|
1424
|
+
/**
|
|
1425
|
+
* Parse a Maven pom.properties file and return its key-value pairs as an object.
|
|
1426
|
+
*
|
|
1427
|
+
* @param {string} pomProperties Raw text contents of a pom.properties file
|
|
1428
|
+
* @returns {Object} Key-value pairs extracted from the properties file
|
|
1429
|
+
*/
|
|
1430
|
+
export function parsePomProperties(pomProperties: string): Object;
|
|
1431
|
+
/**
|
|
1432
|
+
* Encode a string for safe inclusion in a PackageURL, percent-encoding special characters
|
|
1433
|
+
* while preserving already-encoded `%40` sequences and keeping `:` and `/` unencoded.
|
|
1434
|
+
*
|
|
1435
|
+
* @param {string} s String to encode
|
|
1436
|
+
* @returns {string} Encoded string suitable for use in a PackageURL component
|
|
1437
|
+
*/
|
|
1438
|
+
export function encodeForPurl(s: string): string;
|
|
1141
1439
|
/**
|
|
1142
1440
|
* Method to get pom properties from maven directory
|
|
1143
1441
|
*
|
|
@@ -1319,7 +1617,20 @@ export function getMavenCommand(srcPath: string, rootPath: string): string;
|
|
|
1319
1617
|
* Retrieves the atom command by referring to various environment variables
|
|
1320
1618
|
*/
|
|
1321
1619
|
export function getAtomCommand(): any;
|
|
1322
|
-
|
|
1620
|
+
/**
|
|
1621
|
+
* Execute the atom tool against a source directory or file with the given arguments.
|
|
1622
|
+
*
|
|
1623
|
+
* Resolves the atom binary via `getAtomCommand`, sets up the required environment
|
|
1624
|
+
* (including `JAVA_HOME` from `ATOM_JAVA_HOME` if set), and spawns the process.
|
|
1625
|
+
* Logs diagnostic messages for common failure modes such as unsupported Java versions,
|
|
1626
|
+
* missing `astgen`, and JVM crashes.
|
|
1627
|
+
*
|
|
1628
|
+
* @param {string} src Path to the source directory or file to analyse
|
|
1629
|
+
* @param {string[]} args Arguments to pass to the atom command
|
|
1630
|
+
* @param {Object} extra_env Additional environment variables to merge into the process environment
|
|
1631
|
+
* @returns {boolean} `true` if atom executed successfully and the language is supported; `false` otherwise
|
|
1632
|
+
*/
|
|
1633
|
+
export function executeAtom(src: string, args: string[], extra_env?: Object): boolean;
|
|
1323
1634
|
/**
|
|
1324
1635
|
* Find the imported modules in the application with atom parsedeps command
|
|
1325
1636
|
*
|
|
@@ -1377,11 +1688,18 @@ export function getPipTreeForPackages(basePath: string, pkgList: any[], tempVenv
|
|
|
1377
1688
|
dependsOn: any[];
|
|
1378
1689
|
}[];
|
|
1379
1690
|
};
|
|
1380
|
-
|
|
1381
|
-
|
|
1691
|
+
/**
|
|
1692
|
+
* Parse a package.json `name` field (or a plain string) and extract its scope,
|
|
1693
|
+
* full name, project name, and module name components.
|
|
1694
|
+
*
|
|
1695
|
+
* @param {string|Object} name The package name string or an object with a `name` property
|
|
1696
|
+
* @returns {{ scope: string|null, fullName: string, projectName: string|null, moduleName: string|null }}
|
|
1697
|
+
*/
|
|
1698
|
+
export function parsePackageJsonName(name: string | Object): {
|
|
1699
|
+
scope: string | null;
|
|
1382
1700
|
fullName: string;
|
|
1383
|
-
projectName: string;
|
|
1384
|
-
moduleName: string;
|
|
1701
|
+
projectName: string | null;
|
|
1702
|
+
moduleName: string | null;
|
|
1385
1703
|
};
|
|
1386
1704
|
/**
|
|
1387
1705
|
* Method to add occurrence evidence for components based on import statements. Currently useful for js
|
|
@@ -1392,20 +1710,61 @@ export function parsePackageJsonName(name: any): {
|
|
|
1392
1710
|
* @param {Boolean} deep Deep mode
|
|
1393
1711
|
*/
|
|
1394
1712
|
export function addEvidenceForImports(pkgList: array, allImports: object, allExports: object, deep: boolean): Promise<array>;
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1713
|
+
/**
|
|
1714
|
+
* Comparator function for sorting CycloneDX component objects.
|
|
1715
|
+
*
|
|
1716
|
+
* Compares components by `bom-ref`, then `purl`, then `name`, using locale-aware
|
|
1717
|
+
* string comparison on the first available key.
|
|
1718
|
+
*
|
|
1719
|
+
* @param {Object|string} a First component to compare
|
|
1720
|
+
* @param {Object|string} b Second component to compare
|
|
1721
|
+
* @returns {number} Negative, zero, or positive integer as required by Array.sort
|
|
1722
|
+
*/
|
|
1723
|
+
export function componentSorter(a: Object | string, b: Object | string): number;
|
|
1724
|
+
/**
|
|
1725
|
+
* Parse a CMake-generated dot/graphviz file and extract components and their dependency
|
|
1726
|
+
* relationships.
|
|
1727
|
+
*
|
|
1728
|
+
* The first `digraph` entry becomes the parent component. Subsequent `node` entries
|
|
1729
|
+
* with a `label` attribute are treated as direct dependencies, while commented
|
|
1730
|
+
* `node -> node` relationships are used to construct the dependency graph.
|
|
1731
|
+
*
|
|
1732
|
+
* @param {string} dotFile Path to the CMake-generated dot file
|
|
1733
|
+
* @param {string} pkgType PackageURL type to assign to extracted packages (e.g. `"generic"`)
|
|
1734
|
+
* @param {Object} options CLI options; may contain `projectGroup`, `projectName`, and `projectVersion`
|
|
1735
|
+
* @returns {{ parentComponent: Object, pkgList: Object[], dependenciesList: Object[] }}
|
|
1736
|
+
*/
|
|
1737
|
+
export function parseCmakeDotFile(dotFile: string, pkgType: string, options?: Object): {
|
|
1738
|
+
parentComponent: Object;
|
|
1739
|
+
pkgList: Object[];
|
|
1740
|
+
dependenciesList: Object[];
|
|
1403
1741
|
};
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1742
|
+
/**
|
|
1743
|
+
* Parse a CMake-like build file (CMakeLists.txt, meson.build, etc.) and extract the
|
|
1744
|
+
* parent component and list of dependency packages.
|
|
1745
|
+
*
|
|
1746
|
+
* Handles `set`, `project`, `find_package`, `find_library`, `find_dependency`,
|
|
1747
|
+
* `find_file`, `FetchContent_MakeAvailable`, and `dependency()` directives.
|
|
1748
|
+
* Uses the MesonWrapDB to improve name resolution confidence.
|
|
1749
|
+
*
|
|
1750
|
+
* @param {string} cmakeListFile Path to the CMake-like build file
|
|
1751
|
+
* @param {string} pkgType PackageURL type to assign to extracted packages (e.g. `"generic"`)
|
|
1752
|
+
* @param {Object} options CLI options; may contain `projectGroup`, `projectName`, and `projectVersion`
|
|
1753
|
+
* @returns {{ parentComponent: Object, pkgList: Object[] }}
|
|
1754
|
+
*/
|
|
1755
|
+
export function parseCmakeLikeFile(cmakeListFile: string, pkgType: string, options?: Object): {
|
|
1756
|
+
parentComponent: Object;
|
|
1757
|
+
pkgList: Object[];
|
|
1407
1758
|
};
|
|
1408
|
-
|
|
1759
|
+
/**
|
|
1760
|
+
* Find the OS package component that provides a given file, by searching the
|
|
1761
|
+
* `PkgProvides` property of each package in the OS package list.
|
|
1762
|
+
*
|
|
1763
|
+
* @param {string} afile Filename or path to look up (matched case-insensitively)
|
|
1764
|
+
* @param {Object[]} osPkgsList Array of OS package component objects to search
|
|
1765
|
+
* @returns {Object|undefined} The matching OS package component, or undefined if not found
|
|
1766
|
+
*/
|
|
1767
|
+
export function getOSPackageForFile(afile: string, osPkgsList: Object[]): Object | undefined;
|
|
1409
1768
|
/**
|
|
1410
1769
|
* Method to find c/c++ modules by collecting usages with atom
|
|
1411
1770
|
*
|
|
@@ -1415,7 +1774,25 @@ export function getOSPackageForFile(afile: any, osPkgsList: any): any;
|
|
|
1415
1774
|
* @param {array} epkgList Existing packages list
|
|
1416
1775
|
*/
|
|
1417
1776
|
export function getCppModules(src: string, options: object, osPkgsList: array, epkgList: array): {
|
|
1418
|
-
parentComponent:
|
|
1777
|
+
parentComponent: Object | {
|
|
1778
|
+
name: any;
|
|
1779
|
+
version: any;
|
|
1780
|
+
description: any;
|
|
1781
|
+
license: any;
|
|
1782
|
+
purl: string;
|
|
1783
|
+
type: string;
|
|
1784
|
+
"bom-ref": string;
|
|
1785
|
+
group?: undefined;
|
|
1786
|
+
} | {
|
|
1787
|
+
group: any;
|
|
1788
|
+
name: any;
|
|
1789
|
+
version: string;
|
|
1790
|
+
type: string;
|
|
1791
|
+
description?: undefined;
|
|
1792
|
+
license?: undefined;
|
|
1793
|
+
purl?: undefined;
|
|
1794
|
+
"bom-ref"?: undefined;
|
|
1795
|
+
} | undefined;
|
|
1419
1796
|
pkgList: any[];
|
|
1420
1797
|
dependenciesList: {
|
|
1421
1798
|
ref: any;
|
|
@@ -1441,7 +1818,19 @@ export function getNugetMetadata(pkgList: any[], dependencies?: any[]): Promise<
|
|
|
1441
1818
|
pkgList: any[];
|
|
1442
1819
|
dependencies: any[];
|
|
1443
1820
|
}>;
|
|
1444
|
-
|
|
1821
|
+
/**
|
|
1822
|
+
* Enrich .NET package components with occurrence evidence and imported module/method
|
|
1823
|
+
* information from a dosai dependency slices file.
|
|
1824
|
+
*
|
|
1825
|
+
* Builds a mapping of DLL filenames to purls using the `PackageFiles` property of each
|
|
1826
|
+
* package, then reads the slices file to add occurrence locations, imported modules,
|
|
1827
|
+
* called methods, and assembly version information where available.
|
|
1828
|
+
*
|
|
1829
|
+
* @param {Object[]} pkgList Array of .NET package component objects to enrich
|
|
1830
|
+
* @param {string} slicesFile Path to the dosai dependency slices JSON file
|
|
1831
|
+
* @returns {Object[]} The enriched package list (same array, mutated in place)
|
|
1832
|
+
*/
|
|
1833
|
+
export function addEvidenceForDotnet(pkgList: Object[], slicesFile: string): Object[];
|
|
1445
1834
|
/**
|
|
1446
1835
|
* Function to parse the .d make files
|
|
1447
1836
|
*
|
|
@@ -1529,7 +1918,15 @@ export function isValidDriveRoot(root: string): boolean;
|
|
|
1529
1918
|
* Get version and runtime information
|
|
1530
1919
|
*/
|
|
1531
1920
|
export function retrieveCdxgenVersion(): string;
|
|
1532
|
-
|
|
1921
|
+
/**
|
|
1922
|
+
* Retrieve the version of the cdxgen plugins binary package from package.json.
|
|
1923
|
+
*
|
|
1924
|
+
* Reads the local package.json and searches the `optionalDependencies` for a package
|
|
1925
|
+
* whose name starts with `@cdxgen/cdxgen-plugins-bin`, returning its declared version.
|
|
1926
|
+
*
|
|
1927
|
+
* @returns {string|undefined} Version string of the plugins binary package, or undefined if not found
|
|
1928
|
+
*/
|
|
1929
|
+
export function retrieveCdxgenPluginVersion(): string | undefined;
|
|
1533
1930
|
/**
|
|
1534
1931
|
* Helper to split a command line string into an array of arguments,
|
|
1535
1932
|
* respecting single and double quotes.
|
|
@@ -1538,6 +1935,13 @@ export function retrieveCdxgenPluginVersion(): any;
|
|
|
1538
1935
|
* @returns {Array<String>} Array of tokens
|
|
1539
1936
|
*/
|
|
1540
1937
|
export function splitCommandArgs(commandString: string): Array<string>;
|
|
1938
|
+
/**
|
|
1939
|
+
* Convert hyphenated strings to camel case.
|
|
1940
|
+
*
|
|
1941
|
+
* @param {String} str String to convert
|
|
1942
|
+
* @returns {String} camelCased string
|
|
1943
|
+
*/
|
|
1944
|
+
export function toCamel(str: string): string;
|
|
1541
1945
|
export const dirNameStr: any;
|
|
1542
1946
|
export const isSecureMode: any;
|
|
1543
1947
|
export const isNode: boolean;
|
|
@@ -1545,17 +1949,17 @@ export const isBun: boolean;
|
|
|
1545
1949
|
export const isDeno: boolean;
|
|
1546
1950
|
export const isWin: boolean;
|
|
1547
1951
|
export const isMac: boolean;
|
|
1548
|
-
export let ATOM_DB: any;
|
|
1549
1952
|
export const commandsExecuted: Set<any>;
|
|
1550
1953
|
export const frameworksList: any;
|
|
1551
1954
|
export const CDXGEN_VERSION: any;
|
|
1552
1955
|
export const DEBUG_MODE: boolean;
|
|
1956
|
+
export const TABLE_BORDER_STYLE: string;
|
|
1553
1957
|
export const TIMEOUT_MS: number;
|
|
1554
1958
|
export const MAX_BUFFER: number;
|
|
1555
1959
|
export let metadata_cache: {};
|
|
1556
1960
|
export const includeMavenTestScope: boolean;
|
|
1557
1961
|
export const PREFER_MAVEN_DEPS_TREE: boolean;
|
|
1558
|
-
export const FETCH_LICENSE:
|
|
1962
|
+
export const FETCH_LICENSE: boolean;
|
|
1559
1963
|
export const SEARCH_MAVEN_ORG: boolean;
|
|
1560
1964
|
export const JAVA_CMD: string;
|
|
1561
1965
|
export const PYTHON_CMD: string;
|
|
@@ -1606,6 +2010,7 @@ export const PROJECT_TYPE_ALIASES: {
|
|
|
1606
2010
|
scala: string[];
|
|
1607
2011
|
nix: string[];
|
|
1608
2012
|
caxa: string[];
|
|
2013
|
+
"vscode-extension": string[];
|
|
1609
2014
|
};
|
|
1610
2015
|
export namespace PACKAGE_MANAGER_ALIASES {
|
|
1611
2016
|
let scala: string[];
|