Skip to content

Commit

Permalink
feat: expose scan result to formatters
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmed-agabani-snyk committed Jul 29, 2021
1 parent 4ded06f commit 2bd48e8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/lib/snyk-test/legacy.ts
@@ -1,5 +1,6 @@
const values = require('lodash.values');
import * as depGraphLib from '@snyk/dep-graph';
import { ScanResult } from '../ecosystems/types';
import { SupportedPackageManagers } from '../package-managers';
import { SupportedProjectTypes } from '../types';
import { SEVERITIES } from './common';
Expand Down Expand Up @@ -189,6 +190,7 @@ export interface TestResult extends LegacyVulnApiResult {
targetFilePath?: string;
displayTargetFile?: string; // used for display only
foundProjectCount?: number;
scanResult?: ScanResult;
}

interface UpgradePathItem {
Expand Down
3 changes: 3 additions & 0 deletions src/lib/snyk-test/run-test.ts
Expand Up @@ -130,6 +130,7 @@ function prepareEcosystemResponseForParsing(
foundProjectCount: undefined,
payloadPolicy: payloadBody?.policy,
platform,
scanResult: payloadBody,
};
}

Expand Down Expand Up @@ -285,6 +286,7 @@ async function sendAndParseResults(
displayTargetFile,
dockerfilePackages,
platform,
scanResult,
} = prepareResponseForParsing(
payloadCopy,
res as TestDependenciesResponse,
Expand Down Expand Up @@ -317,6 +319,7 @@ async function sendAndParseResults(
foundProjectCount,
displayTargetFile,
platform,
scanResult,
});
}
return results;
Expand Down

0 comments on commit 2bd48e8

Please sign in to comment.