@soos-io/soos-sbom 1.0.17 → 1.1.0-pre.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/index.js +12 -24
- package/package.json +5 -7
package/bin/index.js
CHANGED
|
@@ -20,31 +20,21 @@ class SOOSSBOMAnalysis {
|
|
|
20
20
|
}
|
|
21
21
|
static parseArgs() {
|
|
22
22
|
const analysisArgumentParser = AnalysisArgumentParser_1.default.create(api_client_1.IntegrationName.SoosSbom, api_client_1.IntegrationType.Script, api_client_1.ScanType.SBOM, package_json_1.version);
|
|
23
|
-
analysisArgumentParser.
|
|
24
|
-
|
|
25
|
-
help: "Listing of directories or patterns to exclude from the search for SBOM files. eg: **bin/start/**, **/start/**",
|
|
26
|
-
type: (value) => {
|
|
23
|
+
analysisArgumentParser.addArgument("directoriesToExclude", "Listing of directories or patterns to exclude from the search for SBOM files. eg: **bin/start/**, **/start/**", {
|
|
24
|
+
argParser: (value) => {
|
|
27
25
|
return (0, utilities_2.removeDuplicates)(value.split(",").map((pattern) => pattern.trim()));
|
|
28
26
|
},
|
|
29
|
-
|
|
30
|
-
required: false,
|
|
27
|
+
defaultValue: constants_1.SOOS_SBOM_CONSTANTS.DefaultDirectoriesToExclude,
|
|
31
28
|
});
|
|
32
|
-
analysisArgumentParser.
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
return value.split(",").map((pattern) => pattern.trim());
|
|
29
|
+
analysisArgumentParser.addArgument("filesToExclude", "Listing of files or patterns patterns to exclude from the search for SBOM files. eg: **/int**.cdx.json/, **/internal.cdx.json", {
|
|
30
|
+
argParser: (value) => {
|
|
31
|
+
return (0, utilities_2.removeDuplicates)(value.split(",").map((pattern) => pattern.trim()));
|
|
36
32
|
},
|
|
37
|
-
required: false,
|
|
38
|
-
});
|
|
39
|
-
analysisArgumentParser.argumentParser.add_argument("sbomPath", {
|
|
40
|
-
help: "The SBOM file or folder to scan. When a folder is specified all SBOMs found in the folder and sub-folders will be scanned.",
|
|
41
33
|
});
|
|
42
|
-
analysisArgumentParser.
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
required: false,
|
|
34
|
+
analysisArgumentParser.addArgument("sbomPath", "The SBOM file or folder to scan. When a folder is specified all SBOMs found in the folder and sub-folders will be scanned.", { useNoOptionKey: true });
|
|
35
|
+
analysisArgumentParser.addArgument("outputDirectory", "Absolute path where SOOS will write exported reports and SBOMs. eg Correct: /out/sbom/ | Incorrect: ./out/sbom/", {
|
|
36
|
+
defaultValue: process.cwd(),
|
|
46
37
|
});
|
|
47
|
-
api_client_1.soosLogger.info("Parsing arguments");
|
|
48
38
|
return analysisArgumentParser.parseArguments();
|
|
49
39
|
}
|
|
50
40
|
async runAnalysis() {
|
|
@@ -128,8 +118,8 @@ class SOOSSBOMAnalysis {
|
|
|
128
118
|
scanType,
|
|
129
119
|
});
|
|
130
120
|
if ((0, utilities_1.isScanDone)(scanStatus) &&
|
|
131
|
-
this.args.exportFormat !==
|
|
132
|
-
this.args.exportFileType !==
|
|
121
|
+
this.args.exportFormat !== api_client_1.AttributionFormatEnum.Unknown &&
|
|
122
|
+
this.args.exportFileType !== api_client_1.AttributionFileTypeEnum.Unknown) {
|
|
133
123
|
await soosAnalysisService.generateFormattedOutput({
|
|
134
124
|
clientId: this.args.clientId,
|
|
135
125
|
projectHash: result.projectHash,
|
|
@@ -191,12 +181,10 @@ class SOOSSBOMAnalysis {
|
|
|
191
181
|
return [this.args.sbomPath];
|
|
192
182
|
}
|
|
193
183
|
static async createAndRun() {
|
|
194
|
-
api_client_1.soosLogger.info("Starting SOOS SBOM Analysis");
|
|
195
|
-
api_client_1.soosLogger.logLineSeparator();
|
|
196
184
|
try {
|
|
197
185
|
const args = this.parseArgs();
|
|
198
186
|
api_client_1.soosLogger.setMinLogLevel(args.logLevel);
|
|
199
|
-
api_client_1.soosLogger.info("
|
|
187
|
+
api_client_1.soosLogger.info("Starting SOOS SBOM Analysis");
|
|
200
188
|
api_client_1.soosLogger.debug(JSON.stringify((0, utilities_1.obfuscateProperties)(args, ["apiKey"]), null, 2));
|
|
201
189
|
api_client_1.soosLogger.logLineSeparator();
|
|
202
190
|
const soosSBOMAnalysis = new SOOSSBOMAnalysis(args);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@soos-io/soos-sbom",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.1.0-pre.2",
|
|
4
4
|
"description": "Upload your Software Bill of Materials (SBOM) to SOOS for vulnerability analysis, license matching and more. Register for a free trial today at https://app.soos.io/register",
|
|
5
5
|
"main": "bin/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"setup:update": "npx npm-check -u",
|
|
10
10
|
"setup:clean": "npx rimraf node_modules && npx rimraf package-lock.json",
|
|
11
11
|
"build": "tsc",
|
|
12
|
-
"build:clean": "npx rimraf
|
|
12
|
+
"build:clean": "npx rimraf bin",
|
|
13
13
|
"format": "prettier ./src --check",
|
|
14
14
|
"format:fix": "prettier ./src --write",
|
|
15
15
|
"lint": "eslint --max-warnings 0",
|
|
@@ -42,21 +42,19 @@
|
|
|
42
42
|
},
|
|
43
43
|
"homepage": "https://github.com/soos-io/soos-sbom#readme",
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@soos-io/api-client": "1.
|
|
46
|
-
"argparse": "^2.0.1",
|
|
45
|
+
"@soos-io/api-client": "1.3.1",
|
|
47
46
|
"glob": "^11.0.1",
|
|
48
47
|
"tslib": "^2.6.3"
|
|
49
48
|
},
|
|
50
49
|
"devDependencies": {
|
|
51
50
|
"@eslint/js": "^9.21.0",
|
|
52
|
-
"@types/argparse": "^2.0.16",
|
|
53
51
|
"@types/node": "^20.17.19",
|
|
54
52
|
"eslint": "^9.21.0",
|
|
55
53
|
"globals": "^16.0.0",
|
|
56
|
-
"knip": "^5.
|
|
54
|
+
"knip": "^5.46.0",
|
|
57
55
|
"prettier": "^3.5.1",
|
|
58
56
|
"typescript": "^5.7.3",
|
|
59
|
-
"typescript-eslint": "^8.
|
|
57
|
+
"typescript-eslint": "^8.27.0"
|
|
60
58
|
},
|
|
61
59
|
"bin": {
|
|
62
60
|
"soos-sbom": "bin/index.js"
|