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,6 @@
import { Options } from '../../types';
import { SastSettings, CodeTestResults } from './types';
/**
* Bootstrap and trigger a Code test, then return the results.
*/
export declare function getCodeTestResults(root: string, options: Options, sastSettings: SastSettings, requestId: string): Promise<CodeTestResults | null>;

View File

@@ -0,0 +1,3 @@
import { SastSettings, TrackUsageResponse } from './types';
export declare function getSastSettingsForOrg(org: any): Promise<SastSettings>;
export declare function trackUsage(org: any): Promise<TrackUsageResponse>;

View File

@@ -0,0 +1,7 @@
import { CustomError } from '../../../errors/custom-error';
export declare class CodeClientError extends CustomError {
constructor(statusCode: number, statusText: string, additionalUserHelp?: string);
}
export declare class CodeClientErrorWithDetail extends CustomError {
constructor(message: string, statusCode: number, detail: string);
}

View File

@@ -0,0 +1,3 @@
export { MissingConfigurationError } from './missing-configuration-error';
export { FeatureNotSupportedBySnykCodeError } from './unsupported-feature-snyk-code-error';
export { CodeClientError, CodeClientErrorWithDetail, } from './code-client-error';

View File

@@ -0,0 +1,5 @@
import { CustomError } from '../../../errors/custom-error';
export declare class MissingConfigurationError extends CustomError {
readonly action: string;
constructor(action: string, additionalUserHelp?: string);
}

View File

@@ -0,0 +1,5 @@
import { CustomError } from '../../../errors/custom-error';
export declare class FeatureNotSupportedBySnykCodeError extends CustomError {
readonly feature: string;
constructor(feature: string, additionalUserHelp?: string);
}

View File

@@ -0,0 +1,11 @@
import { Options } from '../../../types';
import { CodeTestResults } from '../types';
export declare function getCodeDisplayedOutput(args: {
testResults: CodeTestResults;
meta: string;
prefix: string;
shouldFilterIgnored: boolean;
}): string;
export declare function getMeta(options: Options, path: string): string;
export declare function getPrefix(path: string): string;
export declare function getCodeReportDisplayedOutput(reportUrl: string): string;

View File

@@ -0,0 +1,2 @@
import { EcosystemPlugin } from '../../ecosystems/types';
export declare const codePlugin: EcosystemPlugin;

View File

@@ -0,0 +1,3 @@
import { SastSettings } from './types';
export declare function isLocalCodeEngine(sastSettings: SastSettings): boolean;
export declare function logLocalCodeEngineVersion(localEngineUrl?: string): Promise<void>;

View File

@@ -0,0 +1,3 @@
import { Options } from '../../types';
import { SastSettings } from './types';
export declare function getSastSettings(options: Options): Promise<SastSettings>;

View File

@@ -0,0 +1,27 @@
export { Log, Tool, Result } from 'sarif';
import { AnalysisResultSarif, FileAnalysis, ReportResult, ScmAnalysis } from '@snyk/code-client';
interface LocalCodeEngine {
enabled: boolean;
url: string;
allowCloudUpload: boolean;
}
export interface SastSettings {
sastEnabled: boolean;
code?: number;
error?: string;
userMessage?: string;
localCodeEngine: LocalCodeEngine;
supportedLanguages?: string[];
org?: string;
}
export interface TrackUsageResponse {
code?: number;
userMessage?: string;
}
export interface CodeTestResults {
reportResults?: ReportResult['uploadResult'];
analysisResults: AnalysisResultSarif;
}
export type CodeAnalysisResults = (FileAnalysis & {
analysisResults: AnalysisResultSarif;
}) | ScmAnalysis;

View File

@@ -0,0 +1,2 @@
import { Result } from 'sarif';
export declare function filterIgnoredIssues(analysisResults: Result[]): Result[];

View File

@@ -0,0 +1,2 @@
export { analysisProgressUpdate } from './testEmitter';
export { filterIgnoredIssues } from './filter';

View File

@@ -0,0 +1 @@
export declare function analysisProgressUpdate(): void;