-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ac807b2
commit 9478923
Showing
7 changed files
with
86 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// Import Node.js Dependencies | ||
import fs from "node:fs/promises"; | ||
|
||
// Import Internal Dependencies | ||
import { buildStatsFromNsecurePayloads } from "../analysis/extractScannerData.js"; | ||
import { HTML, PDF } from "../reporting/index.js"; | ||
import * as CONSTANTS from "../constants.js"; | ||
|
||
export async function report(reportOptions, scannerPayload) { | ||
await fs.mkdir(CONSTANTS.DIRS.REPORTS, { recursive: true }); | ||
|
||
const pkgStats = await buildStatsFromNsecurePayloads(scannerPayload, { isJson: true, reportOptions }); | ||
const fakeSpinner = Object.create(null); | ||
|
||
const reportHTMLPath = await HTML({ pkgStats, repoStats: null, spinner: fakeSpinner }, reportOptions); | ||
|
||
return PDF(reportHTMLPath, { title: reportOptions.title, saveOnDisk: false }); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters