Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(scanner): properly describe Dependencies type #262

Merged
merged 1 commit into from
Aug 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import type {
} from "./formats/osv/index.js";

import type {
Dependencies, ScannerVersionDescriptor
Dependencies
} from "./strategies/types/scanner.js";

import type {
Expand Down Expand Up @@ -105,7 +105,6 @@ export {
ExtendedStrategy,
HydratePayloadDepsOptions,
Dependencies,
ScannerVersionDescriptor,

StandardVulnerability,
StandardPatch,
Expand Down
4 changes: 2 additions & 2 deletions src/strategies/sonatype.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import * as httpie from "@myunisoft/httpie";
import * as utils from "../utils.js";
import { VULN_MODE } from "../constants.js";
import { standardizeVulnsPayload } from "../formats/standard/index.js";
import type { Dependencies, ScannerVersionDescriptor } from "./types/scanner.js";
import type { Dependencies, Dependency } from "./types/scanner.js";
import type {
BaseStrategyOptions,
BaseStrategy
Expand Down Expand Up @@ -66,7 +66,7 @@ function toPackageURL(
* using package's name and different package's versions
*/
function createPackageURLCoordinates(
[dependencyName, dependencyPayload]: [string, ScannerVersionDescriptor]
[dependencyName, dependencyPayload]: [string, Dependency]
) {
const { versions } = dependencyPayload;

Expand Down
12 changes: 8 additions & 4 deletions src/strategies/types/scanner.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
export interface ScannerVersionDescriptor {
versions: string[];
vulnerabilities: any[];
// Import Internal Dependencies
import type { StandardVulnerability } from "../../formats/standard/index.js";

export interface Dependency {
metadata: any;
versions: Record<string, any>;
vulnerabilities: StandardVulnerability[];
}

export type Dependencies = Map<string, ScannerVersionDescriptor>;
export type Dependencies = Map<string, Dependency>;
Loading