@soos-io/api-client
Advanced tools
Comparing version 1.1.0-pre.7 to 1.1.0-pre.8
@@ -21,3 +21,3 @@ import { AttributionFileTypeEnum, AttributionFormatEnum, IntegrationType } from "../enums"; | ||
parseArguments(): any; | ||
validateExportFormatAndFileType(scanType: ScanType | null | undefined, format: AttributionFormatEnum, fileType: AttributionFileTypeEnum): boolean; | ||
isValidExportArguments(scanType: ScanType | null | undefined, format: AttributionFormatEnum, fileType: AttributionFileTypeEnum): boolean; | ||
protected ensureRequiredArguments(args: any): void; | ||
@@ -24,0 +24,0 @@ protected ensureArgumentCombinationsAreValid(args: any): void; |
@@ -8,2 +8,3 @@ "use strict"; | ||
const utilities_1 = require("../utilities"); | ||
const logging_1 = require("../logging"); | ||
const getIntegrateUrl = (scanType) => `${constants_1.SOOS_CONSTANTS.Urls.App.Home}integrate/${scanType == enums_2.ScanType.CSA ? "containers" : (scanType ?? enums_2.ScanType.SCA).toLowerCase()}`; | ||
@@ -82,4 +83,5 @@ class ArgumentParserBase { | ||
} | ||
validateExportFormatAndFileType(scanType, format, fileType) { | ||
isValidExportArguments(scanType, format, fileType) { | ||
const isGeneratedScanType = !(0, utilities_1.isNil)(scanType) && utilities_1.generatedScanTypes.includes(scanType); | ||
logging_1.soosLogger.info(`${scanType} is a generated scan type (${isGeneratedScanType})`); | ||
switch (format) { | ||
@@ -103,4 +105,5 @@ case enums_1.AttributionFormatEnum.CsafVex: | ||
(fileType === enums_1.AttributionFileTypeEnum.Json || fileType === enums_1.AttributionFileTypeEnum.Text)); | ||
default: | ||
return false; | ||
} | ||
return false; | ||
} | ||
@@ -112,3 +115,3 @@ ensureRequiredArguments(args) { | ||
ensureArgumentCombinationsAreValid(args) { | ||
if (!this.validateExportFormatAndFileType(this.scanType, args.format, args.fileType)) { | ||
if (!this.isValidExportArguments(this.scanType, args.format, args.fileType)) { | ||
throw new Error(`Invalid argument combination for ${this.scanType}. Change ${args.exportFormat} and ${args.exportFileType} to a supported combination (https://kb.soos.io/help/soos-reports-for-export).`); | ||
@@ -115,0 +118,0 @@ } |
{ | ||
"name": "@soos-io/api-client", | ||
"version": "1.1.0-pre.7", | ||
"version": "1.1.0-pre.8", | ||
"description": "This is the SOOS API Client for registered clients leveraging the various integrations to the SOOS platform.", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
335189
3389