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 { DepTree } from '../types';
export declare function countTotalDependenciesInTree(depTree: DepTree): number;

View File

@@ -0,0 +1,41 @@
import { Contributor } from '../types';
export declare const SERIOUS_DELIMITER = "_SNYK_SEPARATOR_";
export declare const CONTRIBUTING_DEVELOPER_PERIOD_DAYS = 90;
export declare const MAX_COMMITS_IN_GIT_LOG = 500;
export declare function getContributors({ endDate, periodDays, repoPath }?: {
endDate: Date;
periodDays: number;
repoPath: string;
}): Promise<Contributor[]>;
export declare class GitCommitInfo {
authorEmail: string;
commitTimestamp: string;
constructor(authorEmail: string, commitTimestamp: string);
}
export declare class GitRepoCommitStats {
commitInfos: GitCommitInfo[];
constructor(commitInfos: GitCommitInfo[]);
static empty(): GitRepoCommitStats;
addCommitInfo(info: GitCommitInfo): void;
getUniqueAuthorsCount(): number;
getCommitsCount(): number;
getUniqueAuthorEmails(): Set<string>;
getRepoContributors(): Contributor[];
getMostRecentCommitTimestamp(authorHashedEmail: string): string;
}
export declare function parseGitLogLine(logLine: string): GitCommitInfo;
export declare function parseGitLog(gitLog: string): GitRepoCommitStats;
/**
* @returns time stamp in seconds-since-epoch of 90 days ago since 90 days is the "contributing devs" timeframe
*/
export declare function getTimestampStartOfContributingDevTimeframe(dNow: Date, timespanInDays?: number): number;
export declare function runGitLog(timestampEpochSecondsStartOfPeriod: number, timestampEpochSecondsEndOfPeriod: number, repoPath: string, fnShellout: (cmd: string, workingDirectory: string) => Promise<string>): Promise<string>;
export declare function separateLines(inputText: string): string[];
export declare function execShell(cmd: string, workingDirectory: string): Promise<string>;
export declare class ShellOutError extends Error {
innerError: Error | undefined;
exitCode: number | undefined;
stdout: string | undefined;
stderr: string | undefined;
constructor(message: string, exitCode: number | undefined, stdout: string, stderr: string, innerError: Error | undefined);
}

View File

@@ -0,0 +1,2 @@
import { DepTree } from '../types';
export declare function dropEmptyDeps(depTree: DepTree): import("@snyk/cli-interface/legacy/common").DepTree;

View File

@@ -0,0 +1,7 @@
import { DepTree } from '../types';
interface FilteredDepTree {
filteredDepTree: DepTree;
missingDeps: string[];
}
export declare function filterOutMissingDeps(depTree: DepTree): FilteredDepTree;
export {};

View File

@@ -0,0 +1,5 @@
import { MonitorMeta, MonitorResult, PolicyOptions, MonitorOptions, Options, Contributor, ProjectAttributes, Tag } from '../types';
import { PluginMetadata } from '@snyk/cli-interface/legacy/plugin';
import { ScannedProject } from '@snyk/cli-interface/legacy/common';
export declare function monitor(root: string, meta: MonitorMeta, scannedProject: ScannedProject, options: Options & MonitorOptions & PolicyOptions, pluginMeta: PluginMetadata, targetFileRelativePath?: string, contributors?: Contributor[], projectAttributes?: ProjectAttributes, tags?: Tag[]): Promise<MonitorResult>;
export declare function monitorDepGraph(root: string, meta: MonitorMeta, scannedProject: ScannedProject, pluginMeta: PluginMetadata, options: MonitorOptions & PolicyOptions, targetFileRelativePath?: string, contributors?: Contributor[], projectAttributes?: ProjectAttributes, tags?: Tag[]): Promise<MonitorResult>;

View File

@@ -0,0 +1,2 @@
import { DepTree } from '../types';
export declare function pruneTree(tree: DepTree, packageManagerName: string): Promise<DepTree>;

View File

@@ -0,0 +1,8 @@
import { ScannedProject, DepTree } from '@snyk/cli-interface/legacy/common';
import * as depGraphLib from '@snyk/dep-graph';
import { MonitorMeta } from '../types';
import { PluginMetadata } from '@snyk/cli-interface/legacy/plugin';
export declare function getNameDepTree(scannedProject: ScannedProject, depTree: DepTree, meta: MonitorMeta): string | undefined;
export declare function getNameDepGraph(scannedProject: ScannedProject, depGraph: depGraphLib.DepGraph, meta: MonitorMeta): string | undefined;
export declare function getProjectName(scannedProject: ScannedProject, meta: MonitorMeta): string | undefined;
export declare function getTargetFile(scannedProject: ScannedProject, pluginMeta: PluginMetadata): string | undefined;