@soos-io/api-client
Advanced tools
Comparing version 0.1.10-pre.4 to 0.2.0-pre.1
import SOOSAnalysisApiClient, { ICreateScanRequestContributingDeveloperAudit, ICreateScanResponse } from "../api/SOOSAnalysisApiClient"; | ||
import { OutputFormat, ScanStatus, ScanType } from "../enums"; | ||
interface IRunOutputFormatRequest { | ||
interface IRunOutputFormatParams { | ||
clientId: string; | ||
@@ -14,2 +14,18 @@ projectHash: string; | ||
} | ||
interface ISetupScanParams { | ||
clientId: string; | ||
projectName: string; | ||
branchName: string; | ||
commitHash: string; | ||
buildVersion: string; | ||
buildUri: string; | ||
branchUri: string; | ||
integrationType: string; | ||
operatingEnvironment: string; | ||
integrationName: string; | ||
appVersion: string; | ||
scriptVersion: string; | ||
contributingDeveloperAudit: ICreateScanRequestContributingDeveloperAudit[]; | ||
scanType: ScanType; | ||
} | ||
declare class AnalysisService { | ||
@@ -19,18 +35,12 @@ private analysisApiClient; | ||
static create(apiKey: string, apiURL: string): AnalysisService; | ||
setupScan({ clientId, projectName, branchName, commitHash, buildVersion, buildUri, branchUri, integrationType, operatingEnvironment, integrationName, appVersion, scriptVersion, contributingDeveloperAudit, scanType, }: { | ||
setupScan({ args }: { | ||
args: ISetupScanParams; | ||
}): Promise<ICreateScanResponse>; | ||
startScan({ clientId, projectHash, analysisId, scanType, scanUrl, }: { | ||
clientId: string; | ||
projectName: string; | ||
branchName: string; | ||
commitHash: string; | ||
buildVersion: string; | ||
buildUri: string; | ||
branchUri: string; | ||
integrationType: string; | ||
operatingEnvironment: string; | ||
integrationName: string; | ||
appVersion: string; | ||
scriptVersion: string; | ||
contributingDeveloperAudit: ICreateScanRequestContributingDeveloperAudit[]; | ||
projectHash: string; | ||
analysisId: string; | ||
scanType: ScanType; | ||
}): Promise<ICreateScanResponse>; | ||
scanUrl: string; | ||
}): Promise<void>; | ||
waitForScanToFinish({ scanStatusUrl, scanUrl, }: { | ||
@@ -40,4 +50,4 @@ scanStatusUrl: string; | ||
}): Promise<ScanStatus>; | ||
runOutputFormat({ clientId, projectHash, projectName, branchHash, scanType, analysisId, outputFormat, sourceCodePath, workingDirectory, }: IRunOutputFormatRequest): Promise<void>; | ||
runOutputFormat({ clientId, projectHash, projectName, branchHash, scanType, analysisId, outputFormat, sourceCodePath, workingDirectory, }: IRunOutputFormatParams): Promise<void>; | ||
} | ||
export default AnalysisService; |
@@ -19,22 +19,22 @@ "use strict"; | ||
} | ||
setupScan({ clientId, projectName, branchName, commitHash, buildVersion, buildUri, branchUri, integrationType, operatingEnvironment, integrationName, appVersion, scriptVersion, contributingDeveloperAudit, scanType, }) { | ||
setupScan({ args }) { | ||
return tslib_1.__awaiter(this, void 0, void 0, function* () { | ||
logging_1.soosLogger.info(`Starting SOOS ${scanType} Analysis`); | ||
logging_1.soosLogger.info(`Creating scan for project '${projectName}'...`); | ||
logging_1.soosLogger.info(`Branch Name: ${branchName}`); | ||
logging_1.soosLogger.info(`Starting SOOS ${args.scanType} Analysis`); | ||
logging_1.soosLogger.info(`Creating scan for project '${args.projectName}'...`); | ||
logging_1.soosLogger.info(`Branch Name: ${args.branchName}`); | ||
const result = yield this.analysisApiClient.createScan({ | ||
clientId: clientId, | ||
projectName: projectName, | ||
commitHash: commitHash, | ||
branch: branchName, | ||
buildVersion: buildVersion, | ||
buildUri: buildUri, | ||
branchUri: branchUri, | ||
integrationType: integrationType, | ||
operatingEnvironment: operatingEnvironment, | ||
integrationName: integrationName, | ||
appVersion: appVersion, | ||
scriptVersion: scriptVersion, | ||
contributingDeveloperAudit: contributingDeveloperAudit, | ||
scanType: scanType, | ||
clientId: args.clientId, | ||
projectName: args.projectName, | ||
commitHash: args.commitHash, | ||
branch: args.branchName, | ||
buildVersion: args.buildVersion, | ||
buildUri: args.buildUri, | ||
branchUri: args.branchUri, | ||
integrationType: args.integrationType, | ||
operatingEnvironment: args.operatingEnvironment, | ||
integrationName: args.integrationName, | ||
appVersion: args.appVersion, | ||
scriptVersion: args.scriptVersion, | ||
contributingDeveloperAudit: args.contributingDeveloperAudit, | ||
scanType: args.scanType, | ||
toolName: null, | ||
@@ -50,2 +50,13 @@ toolVersion: null, | ||
} | ||
startScan({ clientId, projectHash, analysisId, scanType, scanUrl, }) { | ||
return tslib_1.__awaiter(this, void 0, void 0, function* () { | ||
logging_1.soosLogger.info(`Starting ${scanType} Analysis scan`); | ||
yield this.analysisApiClient.startScan({ | ||
clientId: clientId, | ||
projectHash: projectHash, | ||
analysisId: analysisId, | ||
}); | ||
logging_1.soosLogger.info(`Analysis scan started successfully, to see the results visit: ${scanUrl}`); | ||
}); | ||
} | ||
waitForScanToFinish({ scanStatusUrl, scanUrl, }) { | ||
@@ -52,0 +63,0 @@ return tslib_1.__awaiter(this, void 0, void 0, function* () { |
{ | ||
"name": "@soos-io/api-client", | ||
"version": "0.1.10-pre.4", | ||
"version": "0.2.0-pre.1", | ||
"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", |
53331
1153