diff --git a/README.md b/README.md index 5c3fc49f..86431bef 100644 --- a/README.md +++ b/README.md @@ -145,10 +145,9 @@ Scan a given sbom for EOL data ``` USAGE - $ hd scan eol [--json] [-f ] [-p ] [-d ] [-s] [-a] [-t] + $ hd scan eol [--json] [-f ] [-p ] [-d ] [-s] FLAGS - -a, --all Show all components (default is EOL and SUPPORTED only) -d, --dir= The directory to scan in order to create a cyclonedx sbom -f, --file= The file path of an existing cyclonedx sbom to scan for EOL -p, --purls= The file path of a list of purls to scan for EOL @@ -166,8 +165,6 @@ EXAMPLES $ hd scan eol --file=path/to/sbom.json $ hd scan eol --purls=path/to/purls.json - - $ hd scan eol -a --dir=./my-project ``` _See code: [src/commands/scan/eol.ts](https://github.com/herodevs/cli/blob/v2.0.0-beta.3/src/commands/scan/eol.ts)_ diff --git a/src/api/types/nes.types.ts b/src/api/types/nes.types.ts index 7558705a..1a29bd30 100644 --- a/src/api/types/nes.types.ts +++ b/src/api/types/nes.types.ts @@ -61,4 +61,4 @@ export interface ScanWarning { } export type ComponentStatus = (typeof VALID_STATUSES)[number]; -export const VALID_STATUSES = ['UNKNOWN', 'OK', 'EOL', 'SUPPORTED'] as const; +export const VALID_STATUSES = ['UNKNOWN', 'OK', 'EOL', 'EOL_UPCOMING'] as const; diff --git a/src/commands/scan/eol.ts b/src/commands/scan/eol.ts index 6b548b6a..02bafdd2 100644 --- a/src/commands/scan/eol.ts +++ b/src/commands/scan/eol.ts @@ -92,7 +92,10 @@ export default class ScanEol extends Command { this.log(ux.colorize('bold', '-'.repeat(40))); const id = scanId.split(SCAN_ID_KEY)[1]; const reportCardUrl = config.eolReportUrl; - const url = ux.colorize('blue', terminalLink(new URL(reportCardUrl).hostname, `${reportCardUrl}/${id}`)); + const url = ux.colorize( + 'blue', + terminalLink(new URL(reportCardUrl).hostname, `${reportCardUrl}/${id}`, { fallback: (url) => url }), + ); this.log(`🌐 View your full EOL report at: ${url}\n`); } @@ -136,9 +139,9 @@ export default class ScanEol extends Command { } private displayResults(components: InsightsEolScanComponent[]) { - const { UNKNOWN, OK, SUPPORTED, EOL, NES_AVAILABLE } = countComponentsByStatus(components); + const { UNKNOWN, OK, EOL_UPCOMING, EOL, NES_AVAILABLE } = countComponentsByStatus(components); - if (!UNKNOWN && !OK && !SUPPORTED && !EOL) { + if (!UNKNOWN && !OK && !EOL_UPCOMING && !EOL) { this.log(ux.colorize('yellow', 'No components found in scan.')); return; } @@ -149,8 +152,8 @@ export default class ScanEol extends Command { this.log(ux.colorize(STATUS_COLORS.EOL, `${INDICATORS.EOL} ${EOL.toLocaleString().padEnd(5)} End-of-Life (EOL)`)); this.log( ux.colorize( - STATUS_COLORS.SUPPORTED, - `${INDICATORS.SUPPORTED}${SUPPORTED.toLocaleString().padEnd(5)} Scheduled EOL`, + STATUS_COLORS.EOL_UPCOMING, + `${INDICATORS.EOL_UPCOMING}${EOL_UPCOMING.toLocaleString().padEnd(5)} EOL Upcoming`, ), ); this.log(ux.colorize(STATUS_COLORS.OK, `${INDICATORS.OK} ${OK.toLocaleString().padEnd(5)} OK`)); @@ -172,7 +175,7 @@ export function countComponentsByStatus( const grouped: Record = { UNKNOWN: 0, OK: 0, - SUPPORTED: 0, + EOL_UPCOMING: 0, EOL: 0, NES_AVAILABLE: 0, }; diff --git a/src/ui/shared.ui.ts b/src/ui/shared.ui.ts index 0b1abc46..f49e5468 100644 --- a/src/ui/shared.ui.ts +++ b/src/ui/shared.ui.ts @@ -5,14 +5,14 @@ export const STATUS_COLORS: Record = { EOL: 'red', UNKNOWN: 'default', OK: 'green', - SUPPORTED: 'yellow', + EOL_UPCOMING: 'yellow', }; export const INDICATORS: Record = { EOL: ux.colorize(STATUS_COLORS.EOL, '✗'), UNKNOWN: ux.colorize(STATUS_COLORS.UNKNOWN, '•'), OK: ux.colorize(STATUS_COLORS.OK, '✔'), - SUPPORTED: ux.colorize(STATUS_COLORS.SUPPORTED, '⚡'), + EOL_UPCOMING: ux.colorize(STATUS_COLORS.EOL_UPCOMING, '⚡'), }; export const SCAN_ID_KEY = 'eol-scan-v1-';