@@ -45,7 +45,7 @@ const definition = await vulnera.getStrategy();
4545console .log (definition .strategy );
4646
4747const vulnerabilities = await definition .getVulnerabilities (process .cwd (), {
48- useStandardFormat : true
48+ useFormat : " Standard "
4949});
5050console .log (vulnerabilities);
5151```
@@ -105,11 +105,10 @@ export interface ExtendedStrategy<
105105 ) => Promise <(VulnFormat | StandardVulnerability )[]>;
106106}
107107
108+ export type BaseStrategyFormat = " Standard" ;
109+
108110export interface BaseStrategyOptions {
109- /**
110- * @default false
111- */
112- useStandardFormat? : boolean ;
111+ useFormat? : BaseStrategyFormat ;
113112}
114113
115114export interface HydratePayloadDepsOptions extends BaseStrategyOptions {
@@ -126,45 +125,8 @@ Where `dependencies` is the dependencies **Map()** object of the NodeSecure Scan
126125> [ !NOTE]
127126> the option ** hydrateDatabase** is only useful for some of the strategy (like Node.js Security WG).
128127
129- ### Standard vulnerability format
130- We provide an high level format that work for all available strategy. It can be activated with the option ` useStandardFormat ` .
131-
132- ``` ts
133- export interface StandardVulnerability {
134- /** Unique identifier for the vulnerability **/
135- id? : string ;
136- /** Vulnerability origin, either Snyk, Sonatype, GitHub or NodeSWG **/
137- origin: Origin ;
138- /** Package associated with the vulnerability **/
139- package: string ;
140- /** Vulnerability title **/
141- title: string ;
142- /** Vulnerability description **/
143- description? : string ;
144- /** Vulnerability link references on origin's website **/
145- url? : string ;
146- /** Vulnerability severity levels given the strategy **/
147- severity? : Severity ;
148- /** Common Vulnerabilities and Exposures dictionary */
149- cves? : string [];
150- /**
151- * Common Vulnerability Scoring System (CVSS) provides a way to capture
152- * the principal characteristics of a vulnerability,
153- * and produce a numerical score reflecting its severity,
154- * as well as a textual representation of that score. **/
155- cvssVector? : string ;
156- /** CVSS Score **/
157- cvssScore? : number ;
158- /** The range of vulnerable versions provided when too many versions are vulnerables */
159- vulnerableRanges: string [];
160- /** The set of versions that are vulnerable **/
161- vulnerableVersions: string [];
162- /** The set of versions that are patched **/
163- patchedVersions? : string ;
164- /** Overview of available patches to get rid of listed vulnerabilities **/
165- patches? : Patch [];
166- }
167- ```
128+ ### Formats
129+ - [ Standard] ( ./docs/formats/standard.md )
168130
169131### Databases
170132- [ OSV] ( ./docs/database/osv.md )
0 commit comments