first
This commit is contained in:
2
safekiso-server/node_modules/snyk/dist/lib/ecosystems/common.d.ts
generated
vendored
Normal file
2
safekiso-server/node_modules/snyk/dist/lib/ecosystems/common.d.ts
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
import { Ecosystem } from './types';
|
||||
export declare function isUnmanagedEcosystem(ecosystem: Ecosystem): boolean;
|
||||
15
safekiso-server/node_modules/snyk/dist/lib/ecosystems/index.d.ts
generated
vendored
Normal file
15
safekiso-server/node_modules/snyk/dist/lib/ecosystems/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
import { Options } from '../types';
|
||||
import { Ecosystem } from './types';
|
||||
export { testEcosystem } from './test';
|
||||
export { monitorEcosystem } from './monitor';
|
||||
export { getPlugin } from './plugins';
|
||||
/**
|
||||
* Ecosystems are listed here if you opt in to the new plugin test flow.
|
||||
* This is a breaking change to the old plugin formats, so only a select few
|
||||
* plugins currently work with it.
|
||||
*
|
||||
* Currently container scanning is not yet ready to work with this flow,
|
||||
* hence this is in a separate function from getEcosystem().
|
||||
*/
|
||||
export declare function getEcosystemForTest(options: Options): Ecosystem | null;
|
||||
export declare function getEcosystem(options: Options): Ecosystem | null;
|
||||
6
safekiso-server/node_modules/snyk/dist/lib/ecosystems/monitor.d.ts
generated
vendored
Normal file
6
safekiso-server/node_modules/snyk/dist/lib/ecosystems/monitor.d.ts
generated
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
import { Contributor, Options, PolicyOptions } from '../types';
|
||||
import { BadResult, GoodResult } from '../../cli/commands/monitor/types';
|
||||
import { Ecosystem, ScanResult, EcosystemMonitorResult, EcosystemMonitorError, MonitorDependenciesRequest } from './types';
|
||||
export declare function monitorEcosystem(ecosystem: Ecosystem, paths: string[], options: Options & PolicyOptions, contributors?: Contributor[]): Promise<[EcosystemMonitorResult[], EcosystemMonitorError[]]>;
|
||||
export declare function generateMonitorDependenciesRequest(scanResult: ScanResult, options: Options): Promise<MonitorDependenciesRequest>;
|
||||
export declare function getFormattedMonitorOutput(results: Array<GoodResult | BadResult>, monitorResults: EcosystemMonitorResult[], errors: EcosystemMonitorError[], options: Options): Promise<string>;
|
||||
2
safekiso-server/node_modules/snyk/dist/lib/ecosystems/plugin-analytics.d.ts
generated
vendored
Normal file
2
safekiso-server/node_modules/snyk/dist/lib/ecosystems/plugin-analytics.d.ts
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
import { Analytics } from './types';
|
||||
export declare function extractAndApplyPluginAnalytics(pluginAnalytics: Analytics[], asyncRequestToken?: string): void;
|
||||
2
safekiso-server/node_modules/snyk/dist/lib/ecosystems/plugins.d.ts
generated
vendored
Normal file
2
safekiso-server/node_modules/snyk/dist/lib/ecosystems/plugins.d.ts
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
import { Ecosystem, EcosystemPlugin } from './types';
|
||||
export declare function getPlugin(ecosystem: Ecosystem): EcosystemPlugin;
|
||||
5
safekiso-server/node_modules/snyk/dist/lib/ecosystems/policy.d.ts
generated
vendored
Normal file
5
safekiso-server/node_modules/snyk/dist/lib/ecosystems/policy.d.ts
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
import { Options, PolicyOptions } from '../types';
|
||||
import { Issue, IssuesData, ScanResult } from './types';
|
||||
import { Policy } from 'snyk-policy';
|
||||
export declare function findAndLoadPolicyForScanResult(scanResult: ScanResult, options: Options & PolicyOptions): Promise<object | undefined>;
|
||||
export declare function filterIgnoredIssues(issues: Issue[], issuesData: IssuesData, policy?: Policy): [Issue[], IssuesData];
|
||||
5
safekiso-server/node_modules/snyk/dist/lib/ecosystems/resolve-monitor-facts.d.ts
generated
vendored
Normal file
5
safekiso-server/node_modules/snyk/dist/lib/ecosystems/resolve-monitor-facts.d.ts
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
import { Contributor, Options } from '../types';
|
||||
import { ScanResult, EcosystemMonitorError, EcosystemMonitorResult } from './types';
|
||||
export declare function resolveAndMonitorFacts(scans: {
|
||||
[dir: string]: ScanResult[];
|
||||
}, options: Options, contributors?: Contributor[]): Promise<[EcosystemMonitorResult[], EcosystemMonitorError[]]>;
|
||||
14
safekiso-server/node_modules/snyk/dist/lib/ecosystems/resolve-test-facts.d.ts
generated
vendored
Normal file
14
safekiso-server/node_modules/snyk/dist/lib/ecosystems/resolve-test-facts.d.ts
generated
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
import { Options, PolicyOptions } from '../types';
|
||||
import { Ecosystem, ScanResult, TestResult } from './types';
|
||||
import { FileHashes, Attributes } from './unmanaged/types';
|
||||
export declare function resolveAndTestFacts(ecosystem: Ecosystem, scans: {
|
||||
[dir: string]: ScanResult[];
|
||||
}, options: Options & PolicyOptions): Promise<[TestResult[], string[]]>;
|
||||
export declare function submitHashes(hashes: FileHashes, orgId: string): Promise<string>;
|
||||
export declare function pollDepGraphAttributes(id: string, orgId: string): Promise<Attributes>;
|
||||
export declare function resolveAndTestFactsUnmanagedDeps(scans: {
|
||||
[dir: string]: ScanResult[];
|
||||
}, options: Options & PolicyOptions): Promise<[TestResult[], string[]]>;
|
||||
export declare function resolveAndTestFactsRegistry(ecosystem: Ecosystem, scans: {
|
||||
[dir: string]: ScanResult[];
|
||||
}, options: Options & PolicyOptions): Promise<[TestResult[], string[]]>;
|
||||
14
safekiso-server/node_modules/snyk/dist/lib/ecosystems/test.d.ts
generated
vendored
Normal file
14
safekiso-server/node_modules/snyk/dist/lib/ecosystems/test.d.ts
generated
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
/// <reference types="node" />
|
||||
import { Writable } from 'stream';
|
||||
import { Options, PolicyOptions } from '../types';
|
||||
import { TestCommandResult } from '../../cli/commands/types';
|
||||
import { Ecosystem, ScanResult, TestResult } from './types';
|
||||
type ScanResultsByPath = {
|
||||
[dir: string]: ScanResult[];
|
||||
};
|
||||
export declare function testEcosystem(ecosystem: Ecosystem, paths: string[], options: Options & PolicyOptions): Promise<TestCommandResult>;
|
||||
export declare function selectAndExecuteTestStrategy(ecosystem: Ecosystem, scanResultsByPath: {
|
||||
[dir: string]: ScanResult[];
|
||||
}, options: Options & PolicyOptions): Promise<[TestResult[], string[]]>;
|
||||
export declare function printUnmanagedDepGraph(results: ScanResultsByPath, target: string, destination: Writable): Promise<TestCommandResult>;
|
||||
export {};
|
||||
132
safekiso-server/node_modules/snyk/dist/lib/ecosystems/types.d.ts
generated
vendored
Normal file
132
safekiso-server/node_modules/snyk/dist/lib/ecosystems/types.d.ts
generated
vendored
Normal file
@@ -0,0 +1,132 @@
|
||||
import { DepGraphData } from '@snyk/dep-graph';
|
||||
import { SEVERITY } from '../snyk-test/common';
|
||||
import { RemediationChanges } from '../snyk-test/legacy';
|
||||
import { Options, ProjectAttributes, Tag } from '../types';
|
||||
export type Ecosystem = 'cpp' | 'docker' | 'code';
|
||||
export type FindingType = 'iacIssue';
|
||||
export interface PluginResponse {
|
||||
scanResults: ScanResult[];
|
||||
}
|
||||
export interface GitTarget {
|
||||
remoteUrl?: string;
|
||||
branch?: string;
|
||||
}
|
||||
export interface ContainerTarget {
|
||||
image: string;
|
||||
}
|
||||
export interface NamedTarget extends GitTarget {
|
||||
name: string;
|
||||
}
|
||||
export interface ScanResult {
|
||||
identity: Identity;
|
||||
facts: Facts[];
|
||||
findings?: Finding[];
|
||||
name?: string;
|
||||
policy?: string;
|
||||
target?: GitTarget | ContainerTarget | NamedTarget;
|
||||
analytics?: Analytics[];
|
||||
targetReference?: string;
|
||||
}
|
||||
export interface Analytics {
|
||||
name: string;
|
||||
data: unknown;
|
||||
}
|
||||
export interface Identity {
|
||||
type: string;
|
||||
targetFile?: string;
|
||||
args?: {
|
||||
[key: string]: string;
|
||||
};
|
||||
}
|
||||
export interface Facts {
|
||||
type: string;
|
||||
data: any;
|
||||
}
|
||||
export interface Finding {
|
||||
type: FindingType;
|
||||
data: any;
|
||||
}
|
||||
interface UpgradePathItem {
|
||||
name: string;
|
||||
version: string;
|
||||
newVersion?: string;
|
||||
isDropped?: boolean;
|
||||
}
|
||||
export interface UpgradePath {
|
||||
path: UpgradePathItem[];
|
||||
}
|
||||
export interface FixInfo {
|
||||
upgradePaths: UpgradePath[];
|
||||
isPatchable: boolean;
|
||||
nearestFixedInVersion?: string;
|
||||
}
|
||||
export interface Issue {
|
||||
pkgName: string;
|
||||
pkgVersion?: string;
|
||||
issueId: string;
|
||||
fixInfo: FixInfo;
|
||||
}
|
||||
export interface IssuesData {
|
||||
[issueId: string]: {
|
||||
id: string;
|
||||
severity: SEVERITY;
|
||||
title: string;
|
||||
};
|
||||
}
|
||||
export interface DepsFilePaths {
|
||||
[pkgKey: string]: string[];
|
||||
}
|
||||
export interface FileSignaturesDetails {
|
||||
[pkgKey: string]: {
|
||||
confidence: number;
|
||||
filePaths: string[];
|
||||
};
|
||||
}
|
||||
export interface TestResult {
|
||||
issues: Issue[];
|
||||
issuesData: IssuesData;
|
||||
depGraphData: DepGraphData;
|
||||
depsFilePaths?: DepsFilePaths;
|
||||
fileSignaturesDetails?: FileSignaturesDetails;
|
||||
remediation?: RemediationChanges;
|
||||
}
|
||||
export interface EcosystemPlugin {
|
||||
scan: (options: Options) => Promise<PluginResponse>;
|
||||
display: (scanResults: ScanResult[], testResults: TestResult[], errors: string[], options: Options) => Promise<string>;
|
||||
test?: (paths: string[], options: Options) => Promise<{
|
||||
readableResult: string;
|
||||
sarifResult?: string;
|
||||
}>;
|
||||
}
|
||||
export interface EcosystemMonitorError {
|
||||
error: string;
|
||||
path: string;
|
||||
scanResult: ScanResult;
|
||||
}
|
||||
export interface MonitorDependenciesResponse {
|
||||
ok: boolean;
|
||||
org: string;
|
||||
id: string;
|
||||
isMonitored: boolean;
|
||||
licensesPolicy: any;
|
||||
uri: string;
|
||||
trialStarted: boolean;
|
||||
path: string;
|
||||
projectName: string;
|
||||
}
|
||||
export interface EcosystemMonitorResult extends MonitorDependenciesResponse {
|
||||
scanResult: ScanResult;
|
||||
}
|
||||
export interface MonitorDependenciesRequest {
|
||||
scanResult: ScanResult;
|
||||
/**
|
||||
* If provided, overrides the default project name (usually equivalent to the root package).
|
||||
* @deprecated Must not be set by new code! Prefer to set the "scanResult.name" within your plugin!
|
||||
*/
|
||||
projectName?: string;
|
||||
policy?: string;
|
||||
method?: 'cli';
|
||||
tags?: Tag[];
|
||||
attributes?: ProjectAttributes;
|
||||
}
|
||||
export {};
|
||||
223
safekiso-server/node_modules/snyk/dist/lib/ecosystems/unmanaged/types.d.ts
generated
vendored
Normal file
223
safekiso-server/node_modules/snyk/dist/lib/ecosystems/unmanaged/types.d.ts
generated
vendored
Normal file
@@ -0,0 +1,223 @@
|
||||
import { SEVERITY } from '../../snyk-test/common';
|
||||
import { PkgInfo } from '@snyk/dep-graph';
|
||||
import { UpgradePath, DepsFilePaths } from '../types';
|
||||
import { SupportedProjectTypes } from '../../types';
|
||||
export interface HashFormat {
|
||||
format: number;
|
||||
data: string;
|
||||
}
|
||||
export interface FileHash {
|
||||
size: number;
|
||||
path: string;
|
||||
hashes_ffm: HashFormat[];
|
||||
}
|
||||
export interface FileHashes {
|
||||
hashes: FileHash[];
|
||||
}
|
||||
export interface LocationResponse {
|
||||
id: string;
|
||||
location: string;
|
||||
type: string;
|
||||
}
|
||||
export interface JsonApi {
|
||||
version: string;
|
||||
}
|
||||
export interface Links {
|
||||
self: string;
|
||||
}
|
||||
export interface CreateDepGraphResponse {
|
||||
data: LocationResponse;
|
||||
jsonapi: JsonApi;
|
||||
links: Links;
|
||||
}
|
||||
export interface DepOpenApi {
|
||||
node_id: string;
|
||||
}
|
||||
interface NodeOpenApi {
|
||||
node_id: string;
|
||||
pkg_id: string;
|
||||
deps: DepOpenApi[];
|
||||
}
|
||||
export interface Details {
|
||||
artifact: string;
|
||||
version: string;
|
||||
author: string;
|
||||
path: string;
|
||||
id: string;
|
||||
url: string;
|
||||
score: string;
|
||||
filePaths: string[];
|
||||
}
|
||||
export interface DetailsOpenApi {
|
||||
artifact: string;
|
||||
version: string;
|
||||
author: string;
|
||||
path: string;
|
||||
id: string;
|
||||
url: string;
|
||||
score: number;
|
||||
file_paths: string[];
|
||||
}
|
||||
export interface ComponentDetails {
|
||||
[key: string]: Details;
|
||||
}
|
||||
export interface ComponentDetailsOpenApi {
|
||||
[key: string]: DetailsOpenApi;
|
||||
}
|
||||
export interface GraphOpenApi {
|
||||
root_node_id: string;
|
||||
nodes: NodeOpenApi[];
|
||||
}
|
||||
export interface Pkg {
|
||||
id: string;
|
||||
info: PkgInfo;
|
||||
}
|
||||
export interface PkgManager {
|
||||
name: string;
|
||||
}
|
||||
export interface DepGraphDataOpenAPI {
|
||||
schema_version: string;
|
||||
pkg_manager: PkgManager;
|
||||
pkgs: Pkg[];
|
||||
graph: GraphOpenApi;
|
||||
}
|
||||
export interface Attributes {
|
||||
start_time: number;
|
||||
in_progress: boolean;
|
||||
dep_graph_data?: DepGraphDataOpenAPI;
|
||||
component_details?: ComponentDetailsOpenApi;
|
||||
}
|
||||
export interface IssuesRequestDetails {
|
||||
artifact: string;
|
||||
version: string;
|
||||
author: string;
|
||||
path: string;
|
||||
id: string;
|
||||
url: string;
|
||||
score: number;
|
||||
file_paths: string[];
|
||||
}
|
||||
export interface IssuesRequestComponentDetails {
|
||||
[key: string]: IssuesRequestDetails;
|
||||
}
|
||||
export interface IssuesRequestDep {
|
||||
nodeId: string;
|
||||
}
|
||||
export interface IssuesRequestDepOpenApi {
|
||||
node_id: string;
|
||||
}
|
||||
export interface IssuesRequestNode {
|
||||
nodeId: string;
|
||||
pkgId: string;
|
||||
deps: IssuesRequestDep[];
|
||||
}
|
||||
export interface IssuesRequestNodeOpenApi {
|
||||
node_id: string;
|
||||
pkg_id: string;
|
||||
deps: IssuesRequestDepOpenApi[];
|
||||
}
|
||||
export interface IssuesRequestGraph {
|
||||
rootNodeId: string;
|
||||
nodes: IssuesRequestNodeOpenApi[];
|
||||
component_details: ComponentDetails;
|
||||
}
|
||||
export interface IssuesRequestGraphOpenApi {
|
||||
root_node_id: string;
|
||||
nodes: IssuesRequestNodeOpenApi[];
|
||||
component_details: ComponentDetailsOpenApi;
|
||||
}
|
||||
export interface IssuesRequestDepGraphDataOpenAPI {
|
||||
schema_version: string;
|
||||
pkg_manager: PkgManager;
|
||||
pkgs: Pkg[];
|
||||
graph: IssuesRequestGraphOpenApi;
|
||||
}
|
||||
export interface IssuesRequestAttributes {
|
||||
start_time: number;
|
||||
dep_graph: IssuesRequestDepGraphDataOpenAPI;
|
||||
component_details: IssuesRequestComponentDetails;
|
||||
target_severity: SEVERITY;
|
||||
}
|
||||
export interface Data {
|
||||
id: string;
|
||||
type: string;
|
||||
attributes: Attributes;
|
||||
}
|
||||
export interface FileSignaturesDetailsOpenApi {
|
||||
[pkgKey: string]: {
|
||||
confidence: number;
|
||||
file_paths: string[];
|
||||
};
|
||||
}
|
||||
export interface FixInfoOpenApi {
|
||||
upgrade_paths: UpgradePath[];
|
||||
is_patchable: boolean;
|
||||
nearest_fixed_in_version?: string;
|
||||
}
|
||||
export interface IssueOpenApi {
|
||||
pkg_name: string;
|
||||
pkg_version?: string;
|
||||
issue_id: string;
|
||||
fix_info: FixInfoOpenApi;
|
||||
}
|
||||
export interface IssuesDataOpenApi {
|
||||
[issueId: string]: IssueDataOpenApi;
|
||||
}
|
||||
export interface GetDepGraphResponse {
|
||||
data: Data;
|
||||
jsonapi: JsonApi;
|
||||
links: Links;
|
||||
}
|
||||
export interface IssuesResponseDataResult {
|
||||
start_time: string;
|
||||
issues: IssueOpenApi[];
|
||||
issues_data: IssuesDataOpenApi;
|
||||
dep_graph: DepGraphDataOpenAPI;
|
||||
deps_file_paths: DepsFilePaths;
|
||||
file_signatures_details: FileSignaturesDetailsOpenApi;
|
||||
type: string;
|
||||
}
|
||||
export interface IssuesResponseData {
|
||||
id: string;
|
||||
result: IssuesResponseDataResult;
|
||||
}
|
||||
export interface GetIssuesResponse {
|
||||
jsonapi: JsonApi;
|
||||
links: Links;
|
||||
data: IssuesResponseData;
|
||||
}
|
||||
interface PatchOpenApi {
|
||||
version: string;
|
||||
id: string;
|
||||
urls: string[];
|
||||
modification_time: string;
|
||||
}
|
||||
export interface IssueDataOpenApi {
|
||||
id: string;
|
||||
package_name: string;
|
||||
version: string;
|
||||
module_name?: string;
|
||||
below: string;
|
||||
semver: {
|
||||
vulnerable: string | string[];
|
||||
vulnerable_hashes?: string[];
|
||||
vulnerable_by_distro?: {
|
||||
[distro_name_and_version: string]: string[];
|
||||
};
|
||||
};
|
||||
patches: PatchOpenApi[];
|
||||
is_new: boolean;
|
||||
description: string;
|
||||
title: string;
|
||||
severity: SEVERITY;
|
||||
fixed_in: string[];
|
||||
legal_instructions?: string;
|
||||
package_manager?: SupportedProjectTypes;
|
||||
from?: string[];
|
||||
name?: string;
|
||||
publication_time?: string;
|
||||
creation_time?: string;
|
||||
cvsSv3?: string;
|
||||
credit?: string[];
|
||||
}
|
||||
export {};
|
||||
35
safekiso-server/node_modules/snyk/dist/lib/ecosystems/unmanaged/utils.d.ts
generated
vendored
Normal file
35
safekiso-server/node_modules/snyk/dist/lib/ecosystems/unmanaged/utils.d.ts
generated
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
import { DepGraphData } from '@snyk/dep-graph';
|
||||
import { ScanResult } from '../types';
|
||||
import { DepGraphDataOpenAPI } from './types';
|
||||
export declare function convertToCamelCase<T>(obj: any): T;
|
||||
export declare function convertMapCasing<T>(obj: any): T;
|
||||
export declare function convertObjectArrayCasing<T>(arr: any[]): T[];
|
||||
export declare function convertDepGraph<T>(depGraphOpenApi: T): DepGraphData;
|
||||
interface SelfResponse {
|
||||
jsonapi: {
|
||||
version: string;
|
||||
};
|
||||
data: {
|
||||
type: string;
|
||||
id: string;
|
||||
attributes: {
|
||||
name: string;
|
||||
username: string;
|
||||
email: string;
|
||||
avatar_url: string;
|
||||
default_org_context: string;
|
||||
};
|
||||
links: {
|
||||
self: string;
|
||||
};
|
||||
};
|
||||
}
|
||||
export declare function getOrgIdFromSlug(slug: string): Promise<string>;
|
||||
export declare function getSelf(): Promise<SelfResponse>;
|
||||
export declare function getOrgDefaultContext(): Promise<string>;
|
||||
export declare function isUUID(str: any): boolean;
|
||||
export declare function getOrg(org?: string | null): Promise<string>;
|
||||
export declare function getUnmanagedDepGraph(scans: {
|
||||
[dir: string]: ScanResult[];
|
||||
}): Promise<DepGraphDataOpenAPI[]>;
|
||||
export {};
|
||||
Reference in New Issue
Block a user