Skip to content
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
14 changes: 13 additions & 1 deletion src/types/eol-scan.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import type { DependencySummary, EolScanComponent } from './eol-scan.js';
import type {
DependencySummary,
EolScanComponent,
NesRemediation,
} from './eol-scan.js';

type Equal<Left, Right> =
(<Value>() => Value extends Left ? 1 : 2) extends <
Expand Down Expand Up @@ -32,3 +36,11 @@ export type ComponentDependencySummaryIsRequired = Assert<
false
>
>;

export type NesRemediationCarriesTheFederationKey = Assert<
Equal<NesRemediation['target'], string | undefined>
>;

export type ComponentNesRemediationIsTheCatalogStub = Assert<
Equal<EolScanComponent['nesRemediation'], NesRemediation | null | undefined>
>;
8 changes: 8 additions & 0 deletions src/types/eol-scan.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,15 @@ export function isUnknownReason(v: unknown): v is UnknownReason {
);
}

/**
* The catalog remediation attached to a scan component as clients see it through
* the gateway. The scan service only emits the federation key (`target`, the
* component purl it was given); the catalog subgraph owns and resolves
* `remediations`. A GraphQL client receives only the fields it selects, so
* `target` is optional: clients that select only `remediations` never see it.
*/
export interface NesRemediation {
target?: string;
remediations: {
purls: { nes: string; oss: string };
urls: { main: string };
Expand Down
Loading