AbstractBulkAdvisoryParser
API reference › Foxy › Audit › Parser › AbstractBulkAdvisoryParser
2 subclasses
Parses the npm registry’s bulk advisories document, which the native manager fetches and bun audit prints.
The document maps each package name to its advisories; it does not say which locked version matched, so the findings carry no affected versions and no dependency paths.
Methods
Section titled “Methods”| Method | Description | Defined by |
|---|---|---|
parse() | Parses a bulk advisories JSON object into normalized findings. | AbstractBulkAdvisoryParser |
assertNotErrorDocument() protected final | Rejects a JSON document that represents a package manager error. | AbstractAuditParser |
assertOutputSize() protected final | Rejects audit output that exceeds the parser’s size limit. | AbstractAuditParser |
decodeObject() protected final | Decodes an audit JSON object after validating its size and shape. | AbstractAuditParser |
getAdvisoryId() protected final | Selects a GHSA identifier from the candidate or URL, falling back to the source identifier. | AbstractAuditParser |
getBoolean() protected final | Returns a required boolean field. | AbstractAuditParser |
getCves() protected final | Returns validated, normalized CVE identifiers. | AbstractAuditParser |
getGhsaId() protected final | Extracts and normalizes a GHSA identifier from a value or URL. | AbstractAuditParser |
getManagerName() protected abstract | Returns the package manager name used in malformed-output errors. | AbstractAuditParser |
getNonNegativeInteger() protected final | Returns a required non-negative integer field. | AbstractAuditParser |
getObject() protected final | Converts a decoded JSON object into its property map. | AbstractAuditParser |
getOptionalString() protected final | Returns a sanitized optional string field, or null when absent or empty. | AbstractAuditParser |
getSeverity() protected final | Returns a supported normalized severity value. | AbstractAuditParser |
getSeverityCount() protected final | Returns the sum of severity counts and optionally validates the reported total. | AbstractAuditParser |
getSourceId() protected final | Returns a non-empty source identifier from a string or integer value. | AbstractAuditParser |
getString() protected final | Returns a required sanitized string field. | AbstractAuditParser |
getStringList() protected final | Returns a normalized list containing only strings. | AbstractAuditParser |
malformed() protected final | Creates a package-manager-specific malformed-output exception. | AbstractAuditParser |
sanitizeString() protected final | Replaces control characters and trims surrounding whitespace. | AbstractAuditParser |
uniqueStrings() protected final | Returns unique strings in deterministic order. | AbstractAuditParser |
Method details
Section titled “Method details”parse()
Section titled “parse() ”public function parse(string $output): arrayParses a bulk advisories JSON object into normalized findings.
Parameters
| Parameter | Type | Description |
|---|---|---|
$output | string |
Returns
array