A TypeScript utility library for End-of-Life (EOL) scanning and analysis.
npm install github:herodevs/eol-shared
- Node.js 22 or higher
Converts an SPDX BOM to CycloneDX format. This conversion takes the most important package and relationship data from SPDX and translates them into CycloneDX components and dependencies as closely as possible.
import { spdxToCdxBom } from '@herodevs/eol-shared';
import type { CdxBom } from '@herodevs/eol-shared';
const spdxBom = {
/* your SPDX BOM data */
};
const cdxBom: CdxBom = spdxToCdxBom(spdxBom);
Parameters: spdxBom
- The SPDX BOM object to convert
Returns: A CycloneDX BOM object
Converts a CycloneDX XML string to a JSON object. The CycloneDX spec does not change between formats, so conversion from XML to JSON is lossless.
import { xmlStringToJSON } from '@herodevs/eol-shared';
import type { CdxBom } from '@herodevs/eol-shared';
const xmlString = `<?xml version="1.0"?>...`;
const jsonBom: CdxBom = xmlStringToJSON(xmlString);
Parameters: xmlString
- The XML string to parse
Returns: The parsed CycloneDX BOM object
Creates a trimmed copy of a CycloneDX BOM by removing SBOM data not necessary for EOL scanning:
externalReferences
from componentsevidence
from componentshashes
from componentsproperties
from components
import { trimCdxBom } from '@herodevs/eol-shared';
import type { CdxBom } from '@herodevs/eol-shared';
const originalBom: CdxBom = {
/* your CycloneDX BOM */
};
const trimmedBom: CdxBom = trimCdxBom(originalBom);
Parameters: cdxBom
- The CycloneDX BOM to trim
Returns: A new trimmed CycloneDX BOM object
The package exports the following TypeScript types:
CdxBom
- CycloneDX BOM structure as exported from@cyclonedx/cyclonedx-library
Component
- Component definitionDependency
- Dependency relationshipHash
- Hash/checksum informationLicense
- License informationExternalReference
- External reference dataComponentScope
- Component scope enumeration
CveStats
- CVE statistics with ID, CVSS score, and publication dateEolScanComponentMetadata
- Metadata for EOL scan components including EOL status, dates, reasons, and CVE informationEolScanComponent
- Component data for EOL scanning with metadata, PURL, and optional NES remediationEolReportMetadata
- Report-level metadata including component countsEolReport
- Complete EOL scan report with components and metadataEolReportQueryResponse
- GraphQL response type for EOL report queriesEolReportMutationResponse
- GraphQL response type for EOL report mutationsCreateEolReportInput
- Input parameters for creating new EOL reportsComponentStatus
- Component status enumeration (UNKNOWN, OK, EOL, EOL_UPCOMING)
This package is designed to work with: