This commit is contained in:
2026-04-07 14:50:23 +09:00
commit b4e485502b
4778 changed files with 2017091 additions and 0 deletions

View File

@@ -0,0 +1,2 @@
import { TestResult } from '../../../lib/snyk-test/legacy';
export declare function dockerRemediationForDisplay(res: TestResult): string;

View File

@@ -0,0 +1 @@
export declare function createDockerBinaryHeading(pkgInfo: any): string;

View File

@@ -0,0 +1,2 @@
import { Options, TestOptions } from '../../../lib/types';
export declare function formatDockerBinariesIssues(dockerBinariesSortedGroupedVulns: any, binariesVulns: any, options: Options & TestOptions): string[];

View File

@@ -0,0 +1,3 @@
export { dockerRemediationForDisplay } from './format-docker-advice';
export { formatDockerBinariesIssues } from './format-docker-binary-issues';
export { createDockerBinaryHeading } from './format-docker-binary-heading';

View File

@@ -0,0 +1 @@
export declare function summariseErrorResults(errorResultsLength: number): string;

View File

@@ -0,0 +1,3 @@
import { MonitorResult } from '../types';
export declare function formatErrorMonitorOutput(packageManager: any, res: MonitorResult, options: any, projectName?: string): string;
export declare function formatMonitorOutput(packageManager: any, res: MonitorResult, options: any, projectName?: string, foundProjectCount?: number): string;

View File

@@ -0,0 +1,4 @@
import { TestOptions, Options } from '../../lib/types';
import { TestResult } from '../../lib/snyk-test/legacy';
import { IacTestResponse } from '../../lib/snyk-test/iac-test-result';
export declare function formatTestMeta(res: TestResult | IacTestResponse, options: Options & TestOptions): string;

View File

@@ -0,0 +1,2 @@
import { Options, TestOptions } from '../../lib/types';
export declare function summariseVulnerableResults(vulnerableResults: any, options: Options & TestOptions): string;

View File

@@ -0,0 +1,4 @@
import * as sarif from 'sarif';
import { TestResult, AnnotatedIssue } from '../snyk-test/legacy';
export declare function getResults(testResult: TestResult): sarif.Result[];
export declare function getLevel(vuln: AnnotatedIssue): "error" | "warning" | "note";

View File

@@ -0,0 +1,2 @@
import { SEVERITY } from '../snyk-test/common';
export declare function getSeverityValue(severity: SEVERITY | 'none'): number;

View File

@@ -0,0 +1 @@
export declare function getVulnerabilityUrl(vulnerabilityId: string): string;

View File

@@ -0,0 +1,3 @@
import { IacTestResponse } from '../../snyk-test/iac-test-result';
import * as sarif from 'sarif';
export declare function createSarifOutputForIac(iacTestResponses: IacTestResponse[]): sarif.Log;

View File

@@ -0,0 +1,2 @@
export { formatIacTestFailures, formatFailuresList } from './list';
export { failuresTipOutput } from './tip';

View File

@@ -0,0 +1,4 @@
import { IaCTestFailure, IaCTestWarning } from '../types';
export declare function formatIacTestFailures(testFailures: IaCTestFailure[]): string;
export declare function formatFailuresList(testFailures: IaCTestFailure[]): string;
export declare function formatIacTestWarnings(testWarnings: IaCTestWarning[]): string;

View File

@@ -0,0 +1 @@
export declare const failuresTipOutput: string;

View File

@@ -0,0 +1,12 @@
import { FormattedResult } from '../../../../cli/commands/test/iac/local-execution/types';
import { Results } from '../../../iac/test/v2/scan/results';
import { IacOutputMeta } from '../../../types';
import { IacTestData } from './types';
interface FormatTestDataParams {
oldFormattedResults: FormattedResult[];
iacOutputMeta: IacOutputMeta | undefined;
ignoresCount: number;
}
export declare function formatTestData({ oldFormattedResults, iacOutputMeta: iacTestMeta, ignoresCount, }: FormatTestDataParams): IacTestData;
export declare function formatSnykIacTestTestData(snykIacTestScanResult: Results | undefined, projectName: string, orgName: string): IacTestData;
export {};

View File

@@ -0,0 +1,7 @@
export { getIacDisplayedIssues } from './issues-list';
export { formatIacTestSummary } from './test-summary';
export { iacTestTitle, spinnerMessage, spinnerSuccessMessage, shouldLogUserMessages, customRulesMessage, customRulesReportMessage, } from './user-messages';
export { formatShareResultsOutput, shareResultsTip, shareCustomRulesDisclaimer, } from './share-results';
export { formatIacTestFailures, formatFailuresList, failuresTipOutput, } from './failures';
export { IaCTestFailure, IaCTestWarning } from './types';
export { formatSnykIacTestTestData, formatTestData } from './formatters';

View File

@@ -0,0 +1,3 @@
import { FormattedOutputResultsBySeverity } from '../types';
import { Options } from './types';
export declare function getIacDisplayedIssues(resultsBySeverity: FormattedOutputResultsBySeverity, options?: Options): string;

View File

@@ -0,0 +1,3 @@
import { FormattedOutputResult } from '../types';
import { Options } from './types';
export declare function formatIssue(result: FormattedOutputResult, options?: Options): string;

View File

@@ -0,0 +1,3 @@
export interface Options {
shouldShowLineNumbers?: boolean;
}

View File

@@ -0,0 +1,6 @@
export declare function formatShareResultsOutput(orgName: string, projectName: string): string;
export declare function formatShareResultsOutputIacPlus(orgName: string, projectName: string): string;
export declare function formatShareResultsOutputIacV2(orgName: string, projectPublicId: string | undefined): string;
export declare const shareResultsTip: string;
export declare const shareCustomRulesDisclaimer: string;
export declare const shareResultsError: string;

View File

@@ -0,0 +1,2 @@
import { IacTestData } from './types';
export declare function formatIacTestSummary(testData: IacTestData): string;

View File

@@ -0,0 +1,41 @@
import { IacProjectType } from '../../../iac/constants';
import { State } from '../../../iac/test/v2/scan/policy-engine';
import { AnnotatedIacIssue } from '../../../snyk-test/iac-test-result';
import { SEVERITY } from '../../../snyk-test/legacy';
import { IacOutputMeta } from '../../../types';
export interface IacTestData {
resultsBySeverity: FormattedOutputResultsBySeverity;
metadata: IacOutputMeta | undefined;
counts: IacTestCounts;
}
export type FormattedOutputResultsBySeverity = {
[severity in SEVERITY]?: FormattedOutputResult[];
};
export type FormattedOutputResult = {
issue: Issue;
projectType: IacProjectType | State.InputTypeEnum;
targetFile?: string;
};
export interface IacTestCounts {
ignores: number;
filesWithIssues: number;
filesWithoutIssues: number;
issues: number;
issuesBySeverity: {
[severity in SEVERITY]: number;
};
contextSuppressedIssues?: number;
}
export type IaCTestFailure = {
filePath: string;
failureReason: string | undefined;
};
export type IaCTestWarning = {
filePath: string;
warningReason: string | undefined;
term: string | undefined;
modules: string[] | undefined;
module: string | undefined;
expressions: string[] | undefined;
};
export type Issue = Pick<AnnotatedIacIssue, 'id' | 'title' | 'severity' | 'issue' | 'impact' | 'resolve' | 'remediation' | 'lineNumber' | 'isGeneratedByCustomRule' | 'documentation' | 'cloudConfigPath'>;

View File

@@ -0,0 +1,25 @@
import { IaCTestFlags } from '../../../../cli/commands/test/iac/local-execution/types';
/**
* Displayed as the title of the test output.
*/
export declare const iacTestTitle: string;
/**
* Progress indication message while files are tested.
*/
export declare const spinnerMessage: string;
/**
* Displayed when a test resolves successfully.
*/
export declare const spinnerSuccessMessage: string;
/**
* Message for using custom rules.
*/
export declare const customRulesMessage: string;
/**
* Message for using custom rules.
*/
export declare const customRulesReportMessage: string;
/**
* @returns whether or not to include user messages in the output.
*/
export declare function shouldLogUserMessages(options: IaCTestFlags): boolean;

View File

@@ -0,0 +1,19 @@
import { Chalk } from 'chalk';
import { SEVERITY } from '../../../snyk-test/common';
interface IacOutputColors {
severities: SeverityColor;
failure: Chalk;
warning: Chalk;
success: Chalk;
info: Chalk;
title: Chalk;
suggestion: Chalk;
}
type SeverityColor = {
[severity in SEVERITY]: Chalk;
};
export declare const colors: IacOutputColors;
export declare const contentPadding: string;
export declare const maxLineWidth: number;
export declare const countSuppressedIssues: (suppressedIssues: Record<string, string[]>) => number;
export {};

View File

@@ -0,0 +1,8 @@
export { formatTestMeta } from './format-test-meta';
export { summariseVulnerableResults } from './format-vulnerable-result-summary';
export { summariseErrorResults } from './format-error-result-summary';
export { formatIssues } from './legacy-format-issue';
export { formatLegalInstructions } from './legal-license-instructions';
export { formatIssuesWithRemediation } from './remediation-based-format-issues';
export { formatErrorMonitorOutput, formatMonitorOutput, } from './format-monitor-response';
export * from './docker';

View File

@@ -0,0 +1,4 @@
import { Options, TestOptions } from '../../lib/types';
import { GroupedVuln } from '../../lib/snyk-test/legacy';
export declare function formatIssues(vuln: GroupedVuln, options: Options & TestOptions): string;
export declare function titleCaseText(text: any): any;

View File

@@ -0,0 +1,2 @@
import { LegalInstruction } from '../../lib/snyk-test/legacy';
export declare function formatLegalInstructions(legalInstructions: LegalInstruction[], paddingLength?: number): string;

View File

@@ -0,0 +1,4 @@
import * as sarif from 'sarif';
import { TestResult } from '../snyk-test/legacy';
export declare function createSarifOutputForOpenSource(testResults: TestResult[]): sarif.Log;
export declare function getRules(testResult: TestResult): sarif.ReportingDescriptor[];

View File

@@ -0,0 +1,4 @@
import { TestOptions } from '../../lib/types';
import { GroupedVuln, RemediationChanges } from '../../lib/snyk-test/legacy';
export declare function formatIssuesWithRemediation(vulns: GroupedVuln[], remediationInfo: RemediationChanges, options: TestOptions): string[];
export declare function printPath(path: string[], slice?: number): string;

View File

@@ -0,0 +1,6 @@
import * as sarif from 'sarif';
import { TestResult } from '../snyk-test/legacy';
import { SEVERITY } from '../snyk-test/legacy';
export declare function createSarifOutputForContainers(testResults: TestResult[]): sarif.Log;
export declare function getIssueLevel(severity: SEVERITY | 'none'): sarif.ReportingConfiguration.level;
export declare function getTool(testResult: any): sarif.Tool;

View File

@@ -0,0 +1 @@
export declare function showAllProjectsTip(packageManager: any, options: any, foundProjectCount: any): string;

View File

@@ -0,0 +1 @@
export declare function showGradleSubProjectsTip(packageManager: any, options: any, foundProjectCount: any): string;

View File

@@ -0,0 +1,3 @@
import { TestResult } from '../snyk-test/legacy';
import { Options, SupportedProjectTypes, TestOptions } from '../types';
export declare function showFixTip(projectType: SupportedProjectTypes, res: TestResult, options: TestOptions & Options): string;

View File

@@ -0,0 +1,3 @@
import { SupportedPackageManagers } from '../package-managers';
import { Options, SupportedProjectTypes, TestOptions } from '../types';
export declare function showMultiScanTip(projectType: SupportedProjectTypes | SupportedPackageManagers, options: Options & TestOptions, foundProjectCount?: number): string;

View File

@@ -0,0 +1,3 @@
import { Options, TestOptions } from '../../../lib/types';
import { TestResult } from '../../../lib/snyk-test/legacy';
export declare function displayResult(res: TestResult, options: Options & TestOptions, foundProjectCount?: number): string;

View File

@@ -0,0 +1,9 @@
import { Options, OutputDataTypes, SupportedProjectTypes, TestOptions } from '../../types';
import { GroupedVuln, TestResult } from '../../snyk-test/legacy';
export declare function extractDataToSendFromResults(results: any, mappedResults: any, options: Options): OutputDataTypes;
export declare function createErrorMappedResultsForJsonOutput(results: any): any;
export declare function getDisplayedOutput(res: TestResult, options: Options & TestOptions, testedInfoText: string, localPackageTest: any, projectType: SupportedProjectTypes, meta: string, prefix: string, hasUnknownVersions: string, multiProjAdvice: string, dockerAdvice: string): string;
export declare function dockerUserCTA(options: any): "" | "\n\nFor more free scans that keep your images secure, sign up to Snyk at https://dockr.ly/3ePqVcp";
export declare function groupVulnerabilities(vulns: any): {
[vulnId: string]: GroupedVuln;
};

View File

@@ -0,0 +1,45 @@
import { LegalInstruction, SEVERITY } from '../../lib/snyk-test/legacy';
export interface BasicVulnInfo {
type: string;
title: string;
severity: SEVERITY;
originalSeverity?: SEVERITY;
isNew: boolean;
name: string;
version: string;
fixedIn: string[];
legalInstructions?: LegalInstruction[];
paths: string[][];
note: string | false;
severityReason?: string;
userNote?: string;
appliedPolicyRules?: AppliedPolicyRules;
}
export interface AppliedPolicyRules {
annotation?: {
value: string;
reason?: string;
};
severityChange?: {
newSeverity?: SEVERITY;
originalSeverity?: SEVERITY;
reason?: string;
};
ignore?: {
path: string[];
source?: string;
created: string;
expires?: string;
reason: string;
disregardIfFixable: boolean;
reasonType: string;
};
}
interface TopLevelPackageUpgrade {
name: string;
version: string;
}
export interface UpgradesByAffectedPackage {
[pkgNameAndVersion: string]: TopLevelPackageUpgrade[];
}
export {};