@soos-io/soos-sbom 1.0.8 → 1.0.9-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.
Files changed (2) hide show
  1. package/bin/index.js +22 -0
  2. package/package.json +2 -2
package/bin/index.js CHANGED
@@ -38,6 +38,11 @@ class SOOSSBOMAnalysis {
38
38
  analysisArgumentParser.argumentParser.add_argument("sbomPath", {
39
39
  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.",
40
40
  });
41
+ analysisArgumentParser.argumentParser.add_argument("--outputDirectory", {
42
+ help: "Absolute path where SOOS will write exported reports and SBOMs. eg Correct: /out/sbom/ | Incorrect: ./out/sbom/",
43
+ default: process.cwd(),
44
+ required: false,
45
+ });
41
46
  api_client_1.soosLogger.info("Parsing arguments");
42
47
  return analysisArgumentParser.parseArguments();
43
48
  }
@@ -121,6 +126,23 @@ class SOOSSBOMAnalysis {
121
126
  scanUrl: result.scanUrl,
122
127
  scanType,
123
128
  });
129
+ if ((0, utilities_1.isScanDone)(scanStatus) &&
130
+ this.args.exportFormat !== undefined &&
131
+ this.args.exportFileType !== undefined) {
132
+ await soosAnalysisService.generateFormattedOutput({
133
+ clientId: this.args.clientId,
134
+ projectHash: result.projectHash,
135
+ projectName: this.args.projectName,
136
+ branchHash: result.branchHash,
137
+ analysisId: result.analysisId,
138
+ format: this.args.exportFormat,
139
+ fileType: this.args.exportFileType,
140
+ includeDependentProjects: false,
141
+ includeOriginalSbom: false,
142
+ includeVulnerabilities: false,
143
+ workingDirectory: this.args.outputDirectory,
144
+ });
145
+ }
124
146
  const exitCodeWithMessage = (0, utilities_1.getAnalysisExitCodeWithMessage)(scanStatus, this.args.integrationName, this.args.onFailure);
125
147
  api_client_1.soosLogger.always(`${exitCodeWithMessage.message} - exit ${exitCodeWithMessage.exitCode}`);
126
148
  (0, process_1.exit)(exitCodeWithMessage.exitCode);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@soos-io/soos-sbom",
3
- "version": "1.0.8",
3
+ "version": "1.0.9-pre.2",
4
4
  "description": "SOOS wrapper script to upload SBOMs.",
5
5
  "main": "bin/index.js",
6
6
  "scripts": {
@@ -39,7 +39,7 @@
39
39
  },
40
40
  "homepage": "https://github.com/soos-io/soos-sbom#readme",
41
41
  "dependencies": {
42
- "@soos-io/api-client": "1.0.14",
42
+ "@soos-io/api-client": "1.1.1",
43
43
  "argparse": "^2.0.1",
44
44
  "glob": "^11.0.0",
45
45
  "tslib": "^2.6.3"