@cyclonedx/cdxgen 10.9.0 → 10.9.2
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/bin/cdxgen.js +6 -1
- package/binary.js +7 -0
- package/index.js +153 -66
- package/package.json +1 -1
- package/types/binary.d.ts.map +1 -1
- package/types/evinser.d.ts +3 -3
- package/types/index.d.ts.map +1 -1
- package/types/utils.d.ts.map +1 -1
- package/utils.js +56 -5
- package/utils.test.js +51 -2
package/bin/cdxgen.js
CHANGED
|
@@ -104,6 +104,11 @@ const args = yargs(hideBin(process.argv))
|
|
|
104
104
|
.option("server-url", {
|
|
105
105
|
description: "Dependency track url. Eg: https://deptrack.cyclonedx.io",
|
|
106
106
|
})
|
|
107
|
+
.option("skip-dt-tls-check", {
|
|
108
|
+
type: "boolean",
|
|
109
|
+
default: false,
|
|
110
|
+
description: "Skip TLS certificate check when calling Dependency-Track. ",
|
|
111
|
+
})
|
|
107
112
|
.option("api-key", {
|
|
108
113
|
description: "Dependency track api key",
|
|
109
114
|
})
|
|
@@ -278,7 +283,7 @@ const args = yargs(hideBin(process.argv))
|
|
|
278
283
|
.option("feature-flags", {
|
|
279
284
|
description: "Experimental feature flags to enable. Advanced users only.",
|
|
280
285
|
hidden: true,
|
|
281
|
-
choices: ["safe-pip-install"],
|
|
286
|
+
choices: ["safe-pip-install", "suggest-build-tools"],
|
|
282
287
|
})
|
|
283
288
|
.completion("completion", "Generate bash/zsh completion")
|
|
284
289
|
.array("type")
|
package/binary.js
CHANGED
|
@@ -271,6 +271,9 @@ const OS_DISTRO_ALIAS = {
|
|
|
271
271
|
"debian-1.3": "bo",
|
|
272
272
|
"debian-1.2": "rex",
|
|
273
273
|
"debian-1.1": "buzz",
|
|
274
|
+
"red hat enterprise linux": "rhel",
|
|
275
|
+
"red hat enterprise linux 8": "rhel-8",
|
|
276
|
+
"red hat enterprise linux 9": "rhel-9",
|
|
274
277
|
};
|
|
275
278
|
|
|
276
279
|
export function getGoBuildInfo(src) {
|
|
@@ -421,9 +424,13 @@ export function getOSPackages(src) {
|
|
|
421
424
|
let distro_codename =
|
|
422
425
|
osReleaseData["VERSION_CODENAME"] ||
|
|
423
426
|
osReleaseData["CENTOS_MANTISBT_PROJECT"] ||
|
|
427
|
+
osReleaseData["REDHAT_BUGZILLA_PRODUCT"] ||
|
|
424
428
|
osReleaseData["REDHAT_SUPPORT_PRODUCT"] ||
|
|
425
429
|
"";
|
|
426
430
|
distro_codename = distro_codename.toLowerCase();
|
|
431
|
+
if (distro_codename.includes(" ") && OS_DISTRO_ALIAS[distro_codename]) {
|
|
432
|
+
distro_codename = OS_DISTRO_ALIAS[distro_codename];
|
|
433
|
+
}
|
|
427
434
|
let distro_id = osReleaseData["ID"] || "";
|
|
428
435
|
const distro_id_like = osReleaseData["ID_LIKE"] || "";
|
|
429
436
|
let purl_type = "rpm";
|
package/index.js
CHANGED
|
@@ -1529,7 +1529,6 @@ export async function createJavaBom(path, options) {
|
|
|
1529
1529
|
) {
|
|
1530
1530
|
parentComponent = bomJsonObj.metadata.component;
|
|
1531
1531
|
options.parentComponent = parentComponent;
|
|
1532
|
-
pkgList = [];
|
|
1533
1532
|
}
|
|
1534
1533
|
if (bomJsonObj.components) {
|
|
1535
1534
|
// Inject evidence into the components. #994
|
|
@@ -1944,9 +1943,15 @@ export async function createJavaBom(path, options) {
|
|
|
1944
1943
|
|
|
1945
1944
|
// Bazel
|
|
1946
1945
|
// Look for the BUILD file only in the root directory
|
|
1947
|
-
|
|
1946
|
+
// NOTE: This can match BUILD files used by perl, so could lead to errors in some projects
|
|
1947
|
+
const bazelFiles = getAllFiles(
|
|
1948
|
+
path,
|
|
1949
|
+
`${options.multiProject ? "**/" : ""}BUILD*`,
|
|
1950
|
+
options,
|
|
1951
|
+
);
|
|
1948
1952
|
if (
|
|
1949
1953
|
bazelFiles?.length &&
|
|
1954
|
+
!hasAnyProjectType(["docker", "oci", "container", "os"], options, false) &&
|
|
1950
1955
|
!options.projectType?.includes("maven") &&
|
|
1951
1956
|
!options.projectType?.includes("gradle") &&
|
|
1952
1957
|
!options.projectType?.includes("scala") &&
|
|
@@ -1959,9 +1964,18 @@ export async function createJavaBom(path, options) {
|
|
|
1959
1964
|
for (const f of bazelFiles) {
|
|
1960
1965
|
const basePath = dirname(f);
|
|
1961
1966
|
// Invoke bazel build first
|
|
1962
|
-
const bazelTarget = process.env.BAZEL_TARGET || "
|
|
1963
|
-
|
|
1964
|
-
|
|
1967
|
+
const bazelTarget = process.env.BAZEL_TARGET || "//...";
|
|
1968
|
+
let bArgs = [
|
|
1969
|
+
...(process.env?.BAZEL_ARGS?.split(" ") || []),
|
|
1970
|
+
"build",
|
|
1971
|
+
bazelTarget,
|
|
1972
|
+
];
|
|
1973
|
+
// Automatically load any bazelrc file
|
|
1974
|
+
if (!process.env.BAZEL_ARGS && existsSync(join(basePath, ".bazelrc"))) {
|
|
1975
|
+
bArgs = ["--bazelrc=.bazelrc", "build", bazelTarget];
|
|
1976
|
+
}
|
|
1977
|
+
console.log("Executing", BAZEL_CMD, bArgs.join(" "), "in", basePath);
|
|
1978
|
+
let result = spawnSync(BAZEL_CMD, bArgs, {
|
|
1965
1979
|
cwd: basePath,
|
|
1966
1980
|
shell: true,
|
|
1967
1981
|
encoding: "utf-8",
|
|
@@ -1978,16 +1992,23 @@ export async function createJavaBom(path, options) {
|
|
|
1978
1992
|
options.failOnError && process.exit(1);
|
|
1979
1993
|
} else {
|
|
1980
1994
|
const target = process.env.BAZEL_TARGET || "//...";
|
|
1981
|
-
let query;
|
|
1995
|
+
let query = [...(process.env?.BAZEL_ARGS?.split(" ") || [])];
|
|
1982
1996
|
let bazelParser;
|
|
1997
|
+
// Automatically load any bazelrc file
|
|
1998
|
+
if (!process.env.BAZEL_ARGS && existsSync(join(basePath, ".bazelrc"))) {
|
|
1999
|
+
query = ["--bazelrc=.bazelrc"];
|
|
2000
|
+
}
|
|
1983
2001
|
if (["true", "1"].includes(process.env.BAZEL_USE_ACTION_GRAPH)) {
|
|
1984
|
-
query = ["aquery", `outputs('.*.jar',deps(${target}))`];
|
|
2002
|
+
query = query.concat(["aquery", `outputs('.*.jar',deps(${target}))`]);
|
|
1985
2003
|
bazelParser = parseBazelActionGraph;
|
|
1986
2004
|
} else {
|
|
1987
|
-
query = [
|
|
2005
|
+
query = query.concat([
|
|
2006
|
+
"aquery",
|
|
2007
|
+
"--output=textproto",
|
|
2008
|
+
"--skyframe_state",
|
|
2009
|
+
]);
|
|
1988
2010
|
bazelParser = parseBazelSkyframe;
|
|
1989
2011
|
}
|
|
1990
|
-
|
|
1991
2012
|
console.log("Executing", BAZEL_CMD, `${query.join(" ")} in`, basePath);
|
|
1992
2013
|
result = spawnSync(BAZEL_CMD, query, {
|
|
1993
2014
|
cwd: basePath,
|
|
@@ -2067,8 +2088,12 @@ export async function createJavaBom(path, options) {
|
|
|
2067
2088
|
options,
|
|
2068
2089
|
);
|
|
2069
2090
|
|
|
2070
|
-
if (
|
|
2071
|
-
|
|
2091
|
+
if (
|
|
2092
|
+
sbtProjects?.length &&
|
|
2093
|
+
!options.projectType?.includes("bazel") &&
|
|
2094
|
+
!options.projectType?.includes("gradle") &&
|
|
2095
|
+
!options.projectType?.includes("maven")
|
|
2096
|
+
) {
|
|
2072
2097
|
// If the project use sbt lock files
|
|
2073
2098
|
if (sbtLockFiles?.length) {
|
|
2074
2099
|
for (const f of sbtLockFiles) {
|
|
@@ -2814,7 +2839,7 @@ export async function createPythonBom(path, options) {
|
|
|
2814
2839
|
const parentDependsOn = [];
|
|
2815
2840
|
// Complete the dependency tree by making parent component depend on the first level
|
|
2816
2841
|
for (const p of retMap.rootList) {
|
|
2817
|
-
parentDependsOn.push(`pkg:pypi/${p.name}@${p.version}`);
|
|
2842
|
+
parentDependsOn.push(`pkg:pypi/${p.name.toLowerCase()}@${p.version}`);
|
|
2818
2843
|
}
|
|
2819
2844
|
const pdependencies = {
|
|
2820
2845
|
ref: parentComponent["bom-ref"],
|
|
@@ -2962,50 +2987,63 @@ export async function createPythonBom(path, options) {
|
|
|
2962
2987
|
} else {
|
|
2963
2988
|
pkgMap = getPipFrozenTree(path, undefined, tempDir, parentComponent);
|
|
2964
2989
|
}
|
|
2990
|
+
|
|
2965
2991
|
// Get the imported modules and a dedupe list of packages
|
|
2966
2992
|
const parentDependsOn = new Set();
|
|
2967
|
-
|
|
2968
|
-
//
|
|
2969
|
-
|
|
2970
|
-
|
|
2971
|
-
|
|
2972
|
-
|
|
2973
|
-
|
|
2974
|
-
|
|
2975
|
-
|
|
2976
|
-
|
|
2977
|
-
|
|
2978
|
-
|
|
2979
|
-
|
|
2980
|
-
|
|
2981
|
-
|
|
2993
|
+
|
|
2994
|
+
// ATOM parsedeps block
|
|
2995
|
+
// Atom parsedeps slices can be used to identify packages that are not declared in manifests
|
|
2996
|
+
// Since it is a slow operation, we only use it as a fallback or in deep mode
|
|
2997
|
+
// This change was made in 10.9.2 release onwards
|
|
2998
|
+
if (options.deep || !pkgList.length) {
|
|
2999
|
+
const retMap = await getPyModules(path, pkgList, options);
|
|
3000
|
+
// We need to patch the existing package list to add ImportedModules for evinse to work
|
|
3001
|
+
if (retMap.modList?.length) {
|
|
3002
|
+
const iSymbolsMap = {};
|
|
3003
|
+
retMap.modList.forEach((v) => {
|
|
3004
|
+
iSymbolsMap[v.name] = v.importedSymbols;
|
|
3005
|
+
iSymbolsMap[v.name.replace(/_/g, "-")] = v.importedSymbols;
|
|
3006
|
+
});
|
|
3007
|
+
for (const apkg of pkgList) {
|
|
3008
|
+
if (iSymbolsMap[apkg.name]) {
|
|
3009
|
+
apkg.properties = apkg.properties || [];
|
|
3010
|
+
apkg.properties.push({
|
|
3011
|
+
name: "ImportedModules",
|
|
3012
|
+
value: iSymbolsMap[apkg.name],
|
|
3013
|
+
});
|
|
3014
|
+
}
|
|
2982
3015
|
}
|
|
2983
3016
|
}
|
|
2984
|
-
|
|
2985
|
-
|
|
2986
|
-
|
|
2987
|
-
|
|
2988
|
-
|
|
2989
|
-
|
|
2990
|
-
|
|
2991
|
-
|
|
2992
|
-
|
|
2993
|
-
|
|
2994
|
-
|
|
3017
|
+
if (retMap.pkgList?.length) {
|
|
3018
|
+
pkgList = pkgList.concat(retMap.pkgList);
|
|
3019
|
+
for (const p of retMap.pkgList) {
|
|
3020
|
+
if (
|
|
3021
|
+
!p.version ||
|
|
3022
|
+
(parentComponent &&
|
|
3023
|
+
p.name === parentComponent.name &&
|
|
3024
|
+
(p.version === parentComponent.version ||
|
|
3025
|
+
p.version === "latest"))
|
|
3026
|
+
) {
|
|
3027
|
+
continue;
|
|
3028
|
+
}
|
|
3029
|
+
parentDependsOn.add(
|
|
3030
|
+
`pkg:pypi/${p.name.toLowerCase()}@${p.version}`,
|
|
3031
|
+
);
|
|
2995
3032
|
}
|
|
2996
|
-
|
|
3033
|
+
}
|
|
3034
|
+
if (retMap.dependenciesList) {
|
|
3035
|
+
dependencies = mergeDependencies(
|
|
3036
|
+
dependencies,
|
|
3037
|
+
retMap.dependenciesList,
|
|
3038
|
+
parentComponent,
|
|
3039
|
+
);
|
|
3040
|
+
}
|
|
3041
|
+
if (retMap.allImports) {
|
|
3042
|
+
allImports = { ...allImports, ...retMap.allImports };
|
|
2997
3043
|
}
|
|
2998
3044
|
}
|
|
2999
|
-
|
|
3000
|
-
|
|
3001
|
-
dependencies,
|
|
3002
|
-
retMap.dependenciesList,
|
|
3003
|
-
parentComponent,
|
|
3004
|
-
);
|
|
3005
|
-
}
|
|
3006
|
-
if (retMap.allImports) {
|
|
3007
|
-
allImports = { ...allImports, ...retMap.allImports };
|
|
3008
|
-
}
|
|
3045
|
+
// ATOM parsedeps block
|
|
3046
|
+
|
|
3009
3047
|
// Complete the dependency tree by making parent component depend on the first level
|
|
3010
3048
|
for (const p of pkgMap.rootList) {
|
|
3011
3049
|
if (
|
|
@@ -3015,7 +3053,7 @@ export async function createPythonBom(path, options) {
|
|
|
3015
3053
|
) {
|
|
3016
3054
|
continue;
|
|
3017
3055
|
}
|
|
3018
|
-
parentDependsOn.add(`pkg:pypi/${p.name}@${p.version}`);
|
|
3056
|
+
parentDependsOn.add(`pkg:pypi/${p.name.toLowerCase()}@${p.version}`);
|
|
3019
3057
|
}
|
|
3020
3058
|
if (pkgMap.pkgList?.length) {
|
|
3021
3059
|
pkgList = pkgList.concat(pkgMap.pkgList);
|
|
@@ -4920,6 +4958,32 @@ export async function createCsharpBom(path, options) {
|
|
|
4920
4958
|
`${options.multiProject ? "**/" : ""}*.nupkg`,
|
|
4921
4959
|
options,
|
|
4922
4960
|
);
|
|
4961
|
+
// Support for detecting and suggesting build tools for this project
|
|
4962
|
+
// We parse all the .csproj files to collect the target framework strings
|
|
4963
|
+
if (isFeatureEnabled(options, "suggest-build-tools")) {
|
|
4964
|
+
const targetFrameworks = new Set();
|
|
4965
|
+
for (const f of csProjFiles) {
|
|
4966
|
+
const csProjData = readFileSync(f, { encoding: "utf-8" });
|
|
4967
|
+
const retMap = parseCsProjData(csProjData, f, {});
|
|
4968
|
+
if (retMap?.parentComponent?.properties) {
|
|
4969
|
+
const parentProperties = retMap.parentComponent.properties;
|
|
4970
|
+
retMap.parentComponent.properties
|
|
4971
|
+
.filter(
|
|
4972
|
+
(p) =>
|
|
4973
|
+
p.name === "cdx:dotnet:target_framework" && p.value.trim().length,
|
|
4974
|
+
)
|
|
4975
|
+
.forEach((p) => {
|
|
4976
|
+
const frameworkValues = p.value
|
|
4977
|
+
.split(";")
|
|
4978
|
+
.filter((v) => v.trim().length && !v.startsWith("$("))
|
|
4979
|
+
.forEach((v) => {
|
|
4980
|
+
targetFrameworks.add(v);
|
|
4981
|
+
});
|
|
4982
|
+
});
|
|
4983
|
+
}
|
|
4984
|
+
}
|
|
4985
|
+
console.log("Target frameworks found:", Array.from(targetFrameworks));
|
|
4986
|
+
}
|
|
4923
4987
|
// Support for automatic restore for .Net projects
|
|
4924
4988
|
if (
|
|
4925
4989
|
options.installDeps &&
|
|
@@ -4969,9 +5033,11 @@ export async function createCsharpBom(path, options) {
|
|
|
4969
5033
|
console.log(
|
|
4970
5034
|
"Authenticate with any private registries such as Azure Artifacts feed before running cdxgen.",
|
|
4971
5035
|
);
|
|
4972
|
-
|
|
4973
|
-
|
|
4974
|
-
|
|
5036
|
+
if (process.env?.CDXGEN_IN_CONTAINER !== "true") {
|
|
5037
|
+
console.log(
|
|
5038
|
+
"Alternatively, try using the unofficial `ghcr.io/appthreat/cdxgen-dotnet6:v10` container image, which bundles nuget (mono) and a range of dotnet SDKs.",
|
|
5039
|
+
);
|
|
5040
|
+
}
|
|
4975
5041
|
}
|
|
4976
5042
|
console.log(result.stdout, result.stderr);
|
|
4977
5043
|
options.failOnError && process.exit(1);
|
|
@@ -5097,10 +5163,6 @@ export async function createCsharpBom(path, options) {
|
|
|
5097
5163
|
console.log(`Parsing ${f}`);
|
|
5098
5164
|
}
|
|
5099
5165
|
pkgData = readFileSync(f, { encoding: "utf-8" });
|
|
5100
|
-
// Remove byte order mark
|
|
5101
|
-
if (pkgData.charCodeAt(0) === 0xfeff) {
|
|
5102
|
-
pkgData = pkgData.slice(1);
|
|
5103
|
-
}
|
|
5104
5166
|
const dlist = parseCsPkgData(pkgData, f);
|
|
5105
5167
|
if (dlist?.length) {
|
|
5106
5168
|
pkgList = pkgList.concat(dlist);
|
|
@@ -5147,13 +5209,9 @@ export async function createCsharpBom(path, options) {
|
|
|
5147
5209
|
if (DEBUG_MODE) {
|
|
5148
5210
|
console.log(`Parsing ${f}`);
|
|
5149
5211
|
}
|
|
5150
|
-
|
|
5151
|
-
// Remove byte order mark
|
|
5152
|
-
if (csProjData.charCodeAt(0) === 0xfeff) {
|
|
5153
|
-
csProjData = csProjData.slice(1);
|
|
5154
|
-
}
|
|
5212
|
+
const csProjData = readFileSync(f, { encoding: "utf-8" });
|
|
5155
5213
|
const retMap = parseCsProjData(csProjData, f, pkgNameVersions);
|
|
5156
|
-
if (retMap?.parentComponent) {
|
|
5214
|
+
if (retMap?.parentComponent?.purl) {
|
|
5157
5215
|
// If there are multiple project files, track the parent components using nested components
|
|
5158
5216
|
if (csProjFiles.length > 1) {
|
|
5159
5217
|
if (!parentComponent.components) {
|
|
@@ -6500,8 +6558,18 @@ export async function submitBom(args, bomContents) {
|
|
|
6500
6558
|
);
|
|
6501
6559
|
}
|
|
6502
6560
|
try {
|
|
6561
|
+
if (DEBUG_MODE && args.skipDtTlsCheck) {
|
|
6562
|
+
console.log(
|
|
6563
|
+
"Calling ",
|
|
6564
|
+
serverUrl,
|
|
6565
|
+
"with --skip-dt-tls-check argument: Skip DT TLS check.",
|
|
6566
|
+
);
|
|
6567
|
+
}
|
|
6503
6568
|
return await got(serverUrl, {
|
|
6504
6569
|
method: "PUT",
|
|
6570
|
+
https: {
|
|
6571
|
+
rejectUnauthorized: !args.skipDtTlsCheck,
|
|
6572
|
+
},
|
|
6505
6573
|
headers: {
|
|
6506
6574
|
"X-Api-Key": args.apiKey,
|
|
6507
6575
|
"Content-Type": "application/json",
|
|
@@ -6517,10 +6585,16 @@ export async function submitBom(args, bomContents) {
|
|
|
6517
6585
|
"Received Unauthorized error. Check the API key used is valid and has necessary permissions to create projects and upload bom.",
|
|
6518
6586
|
);
|
|
6519
6587
|
} else if (error.response && error.response.statusCode === 405) {
|
|
6588
|
+
console.log(
|
|
6589
|
+
"Method PUT not allowed on Dependency-Track server. Trying with POST ...",
|
|
6590
|
+
);
|
|
6520
6591
|
// Method not allowed errors
|
|
6521
6592
|
try {
|
|
6522
6593
|
return await got(serverUrl, {
|
|
6523
6594
|
method: "POST",
|
|
6595
|
+
https: {
|
|
6596
|
+
rejectUnauthorized: !args.skipDtTlsCheck,
|
|
6597
|
+
},
|
|
6524
6598
|
headers: {
|
|
6525
6599
|
"X-Api-Key": args.apiKey,
|
|
6526
6600
|
"Content-Type": "application/json",
|
|
@@ -6530,14 +6604,27 @@ export async function submitBom(args, bomContents) {
|
|
|
6530
6604
|
responseType: "json",
|
|
6531
6605
|
}).json();
|
|
6532
6606
|
} catch (error) {
|
|
6607
|
+
if (DEBUG_MODE) {
|
|
6608
|
+
console.log(
|
|
6609
|
+
"Unable to submit the SBOM to the Dependency-Track server using POST method",
|
|
6610
|
+
error,
|
|
6611
|
+
);
|
|
6612
|
+
} else {
|
|
6613
|
+
console.log(
|
|
6614
|
+
"Unable to submit the SBOM to the Dependency-Track server using POST method",
|
|
6615
|
+
);
|
|
6616
|
+
}
|
|
6617
|
+
}
|
|
6618
|
+
} else {
|
|
6619
|
+
if (DEBUG_MODE) {
|
|
6533
6620
|
console.log(
|
|
6534
6621
|
"Unable to submit the SBOM to the Dependency-Track server using POST method",
|
|
6622
|
+
error,
|
|
6535
6623
|
);
|
|
6624
|
+
} else {
|
|
6625
|
+
console.log("Unable to submit the SBOM to the Dependency-Track server");
|
|
6536
6626
|
}
|
|
6537
|
-
} else {
|
|
6538
|
-
console.log("Unable to submit the SBOM to the Dependency-Track server");
|
|
6539
6627
|
}
|
|
6540
|
-
console.log(error.response?.body);
|
|
6541
6628
|
return error.response?.body;
|
|
6542
6629
|
}
|
|
6543
6630
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cyclonedx/cdxgen",
|
|
3
|
-
"version": "10.9.
|
|
3
|
+
"version": "10.9.2",
|
|
4
4
|
"description": "Creates CycloneDX Software Bill of Materials (SBOM) from source or container image",
|
|
5
5
|
"homepage": "http://github.com/cyclonedx/cdxgen",
|
|
6
6
|
"author": "Prabhu Subramanian <prabhu@appthreat.com>",
|
package/types/binary.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"binary.d.ts","sourceRoot":"","sources":["../binary.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"binary.d.ts","sourceRoot":"","sources":["../binary.js"],"names":[],"mappings":"AAsRA,iDA8BC;AAED,wDAmBC;AAED;;;;;;;EAqXC;AAkCD,gDAoDC;AAED;;;;;;GAMG;AACH,qCAJW,MAAM,cACN,MAAM,WA2BhB;AAED;;;;;;;;GAQG;AACH,kCANW,MAAM,iBACN,MAAM,YACN,OAAO,GAEN,OAAO,CA8BlB"}
|
package/types/evinser.d.ts
CHANGED
|
@@ -30,7 +30,7 @@ export function prepareDB(options: any): Promise<{
|
|
|
30
30
|
changed<K extends keyof any>(key: K, dirty: boolean): void;
|
|
31
31
|
changed(): false | string[];
|
|
32
32
|
previous(): Partial<any>;
|
|
33
|
-
previous<K extends string | number | symbol>(key: K): any
|
|
33
|
+
previous<K extends string | number | symbol>(key: K): any;
|
|
34
34
|
save(options?: import("sequelize").SaveOptions<any>): Promise<any>;
|
|
35
35
|
reload(options?: import("sequelize").FindOptions<any>): Promise<any>;
|
|
36
36
|
validate(options?: import("sequelize/types/instance-validator.js").ValidationOptions): Promise<void>;
|
|
@@ -213,7 +213,7 @@ export function prepareDB(options: any): Promise<{
|
|
|
213
213
|
changed<K extends keyof any>(key: K, dirty: boolean): void;
|
|
214
214
|
changed(): false | string[];
|
|
215
215
|
previous(): Partial<any>;
|
|
216
|
-
previous<K extends string | number | symbol>(key: K): any
|
|
216
|
+
previous<K extends string | number | symbol>(key: K): any;
|
|
217
217
|
save(options?: import("sequelize").SaveOptions<any>): Promise<any>;
|
|
218
218
|
reload(options?: import("sequelize").FindOptions<any>): Promise<any>;
|
|
219
219
|
validate(options?: import("sequelize/types/instance-validator.js").ValidationOptions): Promise<void>;
|
|
@@ -396,7 +396,7 @@ export function prepareDB(options: any): Promise<{
|
|
|
396
396
|
changed<K extends keyof any>(key: K, dirty: boolean): void;
|
|
397
397
|
changed(): false | string[];
|
|
398
398
|
previous(): Partial<any>;
|
|
399
|
-
previous<K extends string | number | symbol>(key: K): any
|
|
399
|
+
previous<K extends string | number | symbol>(key: K): any;
|
|
400
400
|
save(options?: import("sequelize").SaveOptions<any>): Promise<any>;
|
|
401
401
|
reload(options?: import("sequelize").FindOptions<any>): Promise<any>;
|
|
402
402
|
validate(options?: import("sequelize/types/instance-validator.js").ValidationOptions): Promise<void>;
|
package/types/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.js"],"names":[],"mappings":"AAyvBA;;;;;;;;GAQG;AACH,gFAFW,MAAM,SAchB;AAyUD;;;;;;;GAOG;AACH,mCALW,MAAM,qBAiEhB;AAED;;;;;GAKG;AACH,uCAHW,MAAM;;;;EAKhB;AAED;;;;;GAKG;AACH,sCAHW,MAAM;;;;EAkBhB;AAED;;;;;GAKG;AACH,oCAHW,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.js"],"names":[],"mappings":"AAyvBA;;;;;;;;GAQG;AACH,gFAFW,MAAM,SAchB;AAyUD;;;;;;;GAOG;AACH,mCALW,MAAM,qBAiEhB;AAED;;;;;GAKG;AACH,uCAHW,MAAM;;;;EAKhB;AAED;;;;;GAKG;AACH,sCAHW,MAAM;;;;EAkBhB;AAED;;;;;GAKG;AACH,oCAHW,MAAM,8BA0gChB;AAED;;;;;GAKG;AACH,sCAHW,MAAM,8BA2chB;AAED;;;;;GAKG;AACH,sCAHW,MAAM,8BA+ahB;AAED;;;;;GAKG;AACH,kCAHW,MAAM,8BAkUhB;AAED;;;;;GAKG;AACH,oCAHW,MAAM,8BAqIhB;AAED;;;;;GAKG;AACH,oCAHW,MAAM,8BAiDhB;AAED;;;;;GAKG;AACH,mCAHW,MAAM,qBA+KhB;AAED;;;;;GAKG;AACH,uCAHW,MAAM,qBAsHhB;AAED;;;;;GAKG;AACH,uCAHW,MAAM,qBA2BhB;AAED;;;;;GAKG;AACH,sCAHW,MAAM,qBA2BhB;AAED;;;;;GAKG;AACH,sCAHW,MAAM,qBA2BhB;AAED;;;;;GAKG;AACH,0CAHW,MAAM,qBAuBhB;AAED;;;;;GAKG;AACH,kCAHW,MAAM,8BAqDhB;AAED;;;;;GAKG;AACH,uCAHW,MAAM,8BA4ChB;AAED;;;;;GAKG;AACH,oCAHW,MAAM,qBA2BhB;AAED;;;;;GAKG;AACH,qCAHW,MAAM,8BAwFhB;AAED;;;;;GAKG;AACH,iDAHW,MAAM,qBAiUhB;AAED;;;;;GAKG;AACH,mCAHW,MAAM,qBAwJhB;AAED;;;;;GAKG;AACH,oCAHW,MAAM,8BAmFhB;AAED;;;;;GAKG;AACH,sCAHW,MAAM,8BA6XhB;AAED;;;;;GAKG;AACH,2CAHW,MAAM;;;;;;;;;;;;;;;;;;;;GAoChB;AAED;;;;;;;;KA+DC;AAED;;;;;;GAMG;AACH,yDA2CC;AAED;;;;;;;;;GASG;AACH,2GA6BC;AAED;;;;;GAKG;AACH,0CAHW,MAAM,EAAE,8BAmclB;AAED;;;;;GAKG;AACH,iCAHW,MAAM,8BAiUhB;AAED;;;;;GAKG;AACH,gCAHW,MAAM,qBAsOhB;AAED;;;;;;GAMG;AACH,wDAFY,OAAO,CAAC;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,MAAM,EAAE,MAAM,EAAE,CAAA;CAAE,GAAG,SAAS,CAAC,CAwHxE"}
|
package/types/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../utils.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../utils.js"],"names":[],"mappings":"AAuSA;;;;;;;GAOG;AACH,4EAoBC;AAED;;;;;;GAMG;AACH,mGAkDC;AAgBD;;;;;GAKG;AACH,qCAHW,MAAM,WACN,MAAM,0BAqBhB;AAED;;;;;;GAMG;AACH,+CAJW,MAAM,WACN,MAAM,+BAoBhB;AAYD;;;;GAIG;AACH,gCAFa,MAAM,CAIlB;AAED;;;;;;IAMI;AACJ,iDAJW,MAAM,GACJ,OAAO,CAiBnB;AAED;;;;;;;;;GASG;AACH,iEA2BC;AAED;;;;;GAKG;AACH,6CAqDC;AAED;;;;;;GAMG;AACH,sEA0DC;AAED;;;;GAIG;AACH,4EAoCC;AAED;;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;;;EA6PC;AAED,sEA6BC;AAED;;;;;;;GAOG;AACH,mCALW,MAAM,WACN,MAAM;;;;;;;EAgQhB;AAED;;;;;;GAMG;AACH,2CAHW,MAAM,OAKhB;AAED,qDA0CC;AA8HD;;;;GAIG;AACH;;;GAkHC;AAED,yEA0GC;AAED;;;;;;GAMG;AACH,mDAkBC;AAED;;;;;;;;;;GAUG;AACH,0DAqBC;AAED;;;;;GAKG;AACH,4DAWC;AAz2WD,gCAAgF;AAChF,4BAA4C;AAC5C,4BAA6C;AAC7C,2BAAmE;AAsBnE,iCAEE;AAiBF,iCAIyC;AAGzC,gCACmE;AAGnE,gCACsE;AAGtE,8BAA+B;AAK/B,4CAEmE;AAGnE,6CAE6D;AAG7D,oCAEoD;AAGpD,uCAEuD;AAYvD,4BAA6B;AAU7B,8BAAiC;AAMjC,8BAAiC;AAIjC,4BAA6B;AAI7B,2BAA2B;AAI3B,4BAA6B;AAI7B,2BAA2B;AAI3B,6BAA+B;AAI/B,0BAAyB;AAIzB,6BAA+B;AAM/B,2BAA2B;AAK3B,4BAA6B;AAK7B,6BAA+B;AAM/B,kDAWE;AAGF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgEE;AA+FF,8BAQG;AAkzIH,8CAUE"}
|
package/utils.js
CHANGED
|
@@ -239,6 +239,7 @@ export const PROJECT_TYPE_ALIASES = {
|
|
|
239
239
|
"mvn",
|
|
240
240
|
"maven",
|
|
241
241
|
"sbt",
|
|
242
|
+
"bazel",
|
|
242
243
|
],
|
|
243
244
|
android: ["android", "apk", "aab"],
|
|
244
245
|
jar: ["jar", "war", "ear"],
|
|
@@ -6954,6 +6955,10 @@ export function parseCsPkgData(pkgData, pkgFile) {
|
|
|
6954
6955
|
if (!pkgData) {
|
|
6955
6956
|
return pkgList;
|
|
6956
6957
|
}
|
|
6958
|
+
// Remove byte order mark
|
|
6959
|
+
if (pkgData.charCodeAt(0) === 0xfeff) {
|
|
6960
|
+
pkgData = pkgData.slice(1);
|
|
6961
|
+
}
|
|
6957
6962
|
let packages = xml2js(pkgData, {
|
|
6958
6963
|
compact: true,
|
|
6959
6964
|
alwaysArray: true,
|
|
@@ -7010,10 +7015,14 @@ export function parseCsPkgData(pkgData, pkgFile) {
|
|
|
7010
7015
|
*/
|
|
7011
7016
|
export function parseCsProjData(csProjData, projFile, pkgNameVersions = {}) {
|
|
7012
7017
|
const pkgList = [];
|
|
7013
|
-
|
|
7018
|
+
const parentComponent = { type: "application", properties: [] };
|
|
7014
7019
|
if (!csProjData) {
|
|
7015
7020
|
return pkgList;
|
|
7016
7021
|
}
|
|
7022
|
+
// Remove byte order mark
|
|
7023
|
+
if (csProjData.charCodeAt(0) === 0xfeff) {
|
|
7024
|
+
csProjData = csProjData.slice(1);
|
|
7025
|
+
}
|
|
7017
7026
|
let projects = undefined;
|
|
7018
7027
|
try {
|
|
7019
7028
|
projects = xml2js(csProjData, {
|
|
@@ -7079,6 +7088,27 @@ export function parseCsProjData(csProjData, projFile, pkgNameVersions = {}) {
|
|
|
7079
7088
|
});
|
|
7080
7089
|
}
|
|
7081
7090
|
if (
|
|
7091
|
+
apg?.RootNamespace &&
|
|
7092
|
+
Array.isArray(apg.RootNamespace) &&
|
|
7093
|
+
apg.RootNamespace[0]._ &&
|
|
7094
|
+
Array.isArray(apg.RootNamespace[0]._)
|
|
7095
|
+
) {
|
|
7096
|
+
parentComponent.properties.push({
|
|
7097
|
+
name: "Namespaces",
|
|
7098
|
+
value: apg.RootNamespace[0]._[0],
|
|
7099
|
+
});
|
|
7100
|
+
}
|
|
7101
|
+
if (
|
|
7102
|
+
apg?.TargetFramework &&
|
|
7103
|
+
Array.isArray(apg.TargetFramework) &&
|
|
7104
|
+
apg.TargetFramework[0]._ &&
|
|
7105
|
+
Array.isArray(apg.TargetFramework[0]._)
|
|
7106
|
+
) {
|
|
7107
|
+
parentComponent.properties.push({
|
|
7108
|
+
name: "cdx:dotnet:target_framework",
|
|
7109
|
+
value: apg.TargetFramework[0]._[0],
|
|
7110
|
+
});
|
|
7111
|
+
} else if (
|
|
7082
7112
|
apg?.TargetFrameworkVersion &&
|
|
7083
7113
|
Array.isArray(apg.TargetFrameworkVersion) &&
|
|
7084
7114
|
apg.TargetFrameworkVersion[0]._ &&
|
|
@@ -7088,13 +7118,34 @@ export function parseCsProjData(csProjData, projFile, pkgNameVersions = {}) {
|
|
|
7088
7118
|
name: "cdx:dotnet:target_framework",
|
|
7089
7119
|
value: apg.TargetFrameworkVersion[0]._[0],
|
|
7090
7120
|
});
|
|
7121
|
+
} else if (
|
|
7122
|
+
apg?.TargetFrameworks &&
|
|
7123
|
+
Array.isArray(apg.TargetFrameworks) &&
|
|
7124
|
+
apg.TargetFrameworks[0]._ &&
|
|
7125
|
+
Array.isArray(apg.TargetFrameworks[0]._)
|
|
7126
|
+
) {
|
|
7127
|
+
parentComponent.properties.push({
|
|
7128
|
+
name: "cdx:dotnet:target_framework",
|
|
7129
|
+
value: apg.TargetFrameworks[0]._[0],
|
|
7130
|
+
});
|
|
7131
|
+
}
|
|
7132
|
+
if (
|
|
7133
|
+
apg?.Description &&
|
|
7134
|
+
Array.isArray(apg.Description) &&
|
|
7135
|
+
apg.Description[0]._ &&
|
|
7136
|
+
Array.isArray(apg.Description[0]._)
|
|
7137
|
+
) {
|
|
7138
|
+
parentComponent.description = apg.Description[0]._[0];
|
|
7139
|
+
} else if (
|
|
7140
|
+
apg?.PackageDescription &&
|
|
7141
|
+
Array.isArray(apg.PackageDescription) &&
|
|
7142
|
+
apg.PackageDescription[0]._ &&
|
|
7143
|
+
Array.isArray(apg.PackageDescription[0]._)
|
|
7144
|
+
) {
|
|
7145
|
+
parentComponent.description = apg.PackageDescription[0]._[0];
|
|
7091
7146
|
}
|
|
7092
7147
|
}
|
|
7093
7148
|
}
|
|
7094
|
-
// If we are unable to determine the name of the parent component, clear the object
|
|
7095
|
-
if (!parentComponent.purl) {
|
|
7096
|
-
parentComponent = undefined;
|
|
7097
|
-
}
|
|
7098
7149
|
if (project.ItemGroup?.length) {
|
|
7099
7150
|
for (const i in project.ItemGroup) {
|
|
7100
7151
|
const item = project.ItemGroup[i];
|
package/utils.test.js
CHANGED
|
@@ -1855,7 +1855,7 @@ test("parse cs proj", () => {
|
|
|
1855
1855
|
let retMap = parseCsProjData(
|
|
1856
1856
|
readFileSync("./test/sample.csproj", { encoding: "utf-8" }),
|
|
1857
1857
|
);
|
|
1858
|
-
expect(retMap
|
|
1858
|
+
expect(retMap?.parentComponent["bom-ref"]).toBeUndefined();
|
|
1859
1859
|
expect(retMap.pkgList.length).toEqual(5);
|
|
1860
1860
|
expect(retMap.pkgList[0]).toEqual({
|
|
1861
1861
|
"bom-ref": "pkg:nuget/Microsoft.AspNetCore.Mvc.NewtonsoftJson@3.1.1",
|
|
@@ -1864,6 +1864,9 @@ test("parse cs proj", () => {
|
|
|
1864
1864
|
version: "3.1.1",
|
|
1865
1865
|
purl: "pkg:nuget/Microsoft.AspNetCore.Mvc.NewtonsoftJson@3.1.1",
|
|
1866
1866
|
});
|
|
1867
|
+
expect(retMap?.parentComponent.properties).toEqual([
|
|
1868
|
+
{ name: "cdx:dotnet:target_framework", value: "netcoreapp3.1" },
|
|
1869
|
+
]);
|
|
1867
1870
|
retMap = parseCsProjData(
|
|
1868
1871
|
readFileSync("./test/data/WindowsFormsApplication1.csproj", {
|
|
1869
1872
|
encoding: "utf-8",
|
|
@@ -1876,6 +1879,10 @@ test("parse cs proj", () => {
|
|
|
1876
1879
|
name: "cdx:dotnet:project_guid",
|
|
1877
1880
|
value: "{3336A23A-6F2C-46D4-89FA-93C726CEB23D}",
|
|
1878
1881
|
},
|
|
1882
|
+
{
|
|
1883
|
+
name: "Namespaces",
|
|
1884
|
+
value: "WindowsFormsApplication1",
|
|
1885
|
+
},
|
|
1879
1886
|
{ name: "cdx:dotnet:target_framework", value: "v4.8" },
|
|
1880
1887
|
],
|
|
1881
1888
|
name: "WindowsFormsApplication1",
|
|
@@ -1957,6 +1964,20 @@ test("parse cs proj", () => {
|
|
|
1957
1964
|
],
|
|
1958
1965
|
},
|
|
1959
1966
|
]);
|
|
1967
|
+
expect(retMap?.parentComponent.properties).toEqual([
|
|
1968
|
+
{
|
|
1969
|
+
name: "cdx:dotnet:project_guid",
|
|
1970
|
+
value: "{3336A23A-6F2C-46D4-89FA-93C726CEB23D}",
|
|
1971
|
+
},
|
|
1972
|
+
{
|
|
1973
|
+
name: "Namespaces",
|
|
1974
|
+
value: "WindowsFormsApplication1",
|
|
1975
|
+
},
|
|
1976
|
+
{
|
|
1977
|
+
name: "cdx:dotnet:target_framework",
|
|
1978
|
+
value: "v4.8",
|
|
1979
|
+
},
|
|
1980
|
+
]);
|
|
1960
1981
|
retMap = parseCsProjData(
|
|
1961
1982
|
readFileSync("./test/data/Server.csproj", {
|
|
1962
1983
|
encoding: "utf-8",
|
|
@@ -1969,6 +1990,7 @@ test("parse cs proj", () => {
|
|
|
1969
1990
|
name: "cdx:dotnet:project_guid",
|
|
1970
1991
|
value: "{6BA9F9E1-E43C-489D-A3B4-8916CA2D4C5F}",
|
|
1971
1992
|
},
|
|
1993
|
+
{ name: "Namespaces", value: "OutputMgr.Server" },
|
|
1972
1994
|
{ name: "cdx:dotnet:target_framework", value: "v4.8" },
|
|
1973
1995
|
],
|
|
1974
1996
|
name: "Server",
|
|
@@ -1977,6 +1999,30 @@ test("parse cs proj", () => {
|
|
|
1977
1999
|
"bom-ref": "pkg:nuget/Server@9.0.21022",
|
|
1978
2000
|
});
|
|
1979
2001
|
expect(retMap.pkgList.length).toEqual(34);
|
|
2002
|
+
expect(retMap?.parentComponent.properties).toEqual([
|
|
2003
|
+
{
|
|
2004
|
+
name: "cdx:dotnet:project_guid",
|
|
2005
|
+
value: "{6BA9F9E1-E43C-489D-A3B4-8916CA2D4C5F}",
|
|
2006
|
+
},
|
|
2007
|
+
{
|
|
2008
|
+
name: "Namespaces",
|
|
2009
|
+
value: "OutputMgr.Server",
|
|
2010
|
+
},
|
|
2011
|
+
{
|
|
2012
|
+
name: "cdx:dotnet:target_framework",
|
|
2013
|
+
value: "v4.8",
|
|
2014
|
+
},
|
|
2015
|
+
]);
|
|
2016
|
+
retMap = parseCsProjData(
|
|
2017
|
+
readFileSync("./test/data/Logging.csproj", {
|
|
2018
|
+
encoding: "utf-8",
|
|
2019
|
+
}),
|
|
2020
|
+
);
|
|
2021
|
+
expect(retMap?.parentComponent["bom-ref"]).toBeUndefined();
|
|
2022
|
+
expect(retMap?.parentComponent.properties).toEqual([
|
|
2023
|
+
{ name: "Namespaces", value: "Sample.OData" },
|
|
2024
|
+
{ name: "cdx:dotnet:target_framework", value: "$(TargetFrameworks);" },
|
|
2025
|
+
]);
|
|
1980
2026
|
});
|
|
1981
2027
|
|
|
1982
2028
|
test("parse project.assets.json", () => {
|
|
@@ -2194,7 +2240,10 @@ test("parse .net cs proj", () => {
|
|
|
2194
2240
|
);
|
|
2195
2241
|
expect(retMap.parentComponent).toEqual({
|
|
2196
2242
|
type: "library",
|
|
2197
|
-
properties: [
|
|
2243
|
+
properties: [
|
|
2244
|
+
{ name: "Namespaces", value: "Calculator" },
|
|
2245
|
+
{ name: "cdx:dotnet:target_framework", value: "v4.6.2" },
|
|
2246
|
+
],
|
|
2198
2247
|
name: "Calculator",
|
|
2199
2248
|
purl: "pkg:nuget/Calculator@latest",
|
|
2200
2249
|
"bom-ref": "pkg:nuget/Calculator@latest",
|