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,3 @@
import { StandardAnalyticsData } from './types';
import { ArgsOptions } from '../../cli/args';
export declare function getStandardData(args: ArgsOptions[]): Promise<StandardAnalyticsData>;

View File

@@ -0,0 +1,18 @@
import * as needle from 'needle';
/**
*
* @param data the data to merge into that data which has been staged thus far (with the {@link add} function)
* and then sent to the backend.
*/
export declare function addDataAndSend(data: any): Promise<void | {
res: needle.NeedleResponse;
body: any;
}>;
export declare function allowAnalytics(): boolean;
/**
* Adds a key-value pair to the analytics data `metadata` field. This doesn't send the analytics, just stages it for
* sending later (via the {@link addDataAndSend} function).
* @param key
* @param value
*/
export declare function add(key: string, value: unknown): void;

View File

@@ -0,0 +1,14 @@
import { ArgsOptions } from '../../cli/args';
export declare const INTEGRATION_NAME_ENVVAR = "SNYK_INTEGRATION_NAME";
export declare const INTEGRATION_VERSION_ENVVAR = "SNYK_INTEGRATION_VERSION";
export declare const INTEGRATION_ENVIRONMENT_ENVVAR = "SNYK_INTEGRATION_ENVIRONMENT";
export declare const INTEGRATION_ENVIRONMENT_VERSION_ENVVAR = "SNYK_INTEGRATION_ENVIRONMENT_VERSION";
export declare const getIntegrationName: (args: ArgsOptions[]) => string;
export declare const getIntegrationVersion: (args: ArgsOptions[]) => string;
export declare const getIntegrationEnvironment: (args: ArgsOptions[]) => string;
export declare const getIntegrationEnvironmentVersion: (args: ArgsOptions[]) => string;
export declare function isScoop(): boolean;
export declare function validateScoopManifestFile(snykExecutablePath: string): boolean;
export declare function isHomebrew(): boolean;
export declare function validateHomebrew(snykExecutablePath: string): boolean;
export declare function isInstalled(commandToCheck: string): Promise<boolean>;

View File

@@ -0,0 +1,14 @@
export type StandardAnalyticsData = {
version: string;
os: string;
nodeVersion: string;
standalone: boolean;
integrationName: string;
integrationVersion: string;
integrationEnvironment: string;
integrationEnvironmentVersion: string;
id: string;
ci: boolean;
durationMs: number;
metrics: any[] | undefined;
};