UNPKG

2.56 kBTypeScriptView Raw
1import { DepGraph } from '@snyk/dep-graph';
2import { legacyPlugin as api } from '@snyk/cli-interface';
3import { getGradleAttributesPretty } from './gradle-attributes-pretty';
4export interface GradleInspectOptions {
5 'configuration-matching'?: string;
6 'configuration-attributes'?: string;
7 daemon?: boolean;
8 reachableVulns?: boolean;
9 callGraphBuilderTimeout?: number;
10 initScript?: string;
11 gradleAcceptLegacyConfigRoles?: boolean;
12}
13declare type Options = api.InspectOptions & GradleInspectOptions;
14declare type VersionBuildInfo = api.VersionBuildInfo;
15export declare function inspect(root: string, targetFile: string, options?: api.SingleSubprojectInspectOptions & GradleInspectOptions): Promise<api.SinglePackageResult>;
16export declare function inspect(root: string, targetFile: string, options: api.MultiSubprojectInspectOptions & GradleInspectOptions): Promise<api.MultiProjectResult>;
17export interface JsonDepsScriptResult {
18 defaultProject: string;
19 projects: ProjectsDict;
20 allSubProjectNames: string[];
21 versionBuildInfo?: VersionBuildInfo;
22}
23interface SnykGraph {
24 name: string;
25 version: string;
26 parentIds: string[];
27}
28interface ProjectsDict {
29 [project: string]: GradleProjectInfo;
30}
31interface GradleProjectInfo {
32 depGraph?: DepGraph;
33 snykGraph?: {
34 [name: string]: SnykGraph;
35 };
36 targetFile: string;
37 projectVersion: string;
38}
39declare function extractJsonFromScriptOutput(stdoutText: string): JsonDepsScriptResult;
40export declare function buildGraph(snykGraph: {
41 [dependencyId: string]: SnykGraph;
42}, projectName: string, projectVersion: string): Promise<DepGraph>;
43declare function getPluginFileName(options: Options): string;
44declare function getVersionBuildInfo(gradleVersionOutput: string): VersionBuildInfo | undefined;
45export declare function processProjectsInExtractedJSON(root: string, extractedJSON: JsonDepsScriptResult): Promise<JsonDepsScriptResult>;
46declare function toCamelCase(input: string): string;
47export declare function formatArgWithWhiteSpace(arg: string): string;
48declare function buildArgs(root: string, targetFile: string | null, initGradlePath: string, options: Options): string[];
49export declare const exportsForTests: {
50 buildArgs: typeof buildArgs;
51 extractJsonFromScriptOutput: typeof extractJsonFromScriptOutput;
52 getVersionBuildInfo: typeof getVersionBuildInfo;
53 toCamelCase: typeof toCamelCase;
54 getGradleAttributesPretty: typeof getGradleAttributesPretty;
55 getPluginFileName: typeof getPluginFileName;
56};
57export {};