import { PackageURL } from "packageurl-js"; export declare const RegexNotToBeLogged: RegExp; /** * * @param {string} key to log its value from environment variables and from opts, if it exists * @param {{}} [opts={}] different options of application, if key in it, log it. * @param {string }defValue default value of key in case there is no option and environment variable values for key */ export declare function logValueFromObjects(key: string, opts?: {}, defValue: string): void; /** * Utility function returns the value for key from opts, then environment variables, * then the supplied default. Values from opts are used only if they are strings. * @param {string} key the key to look for in the environment variables and the opts object * @param {string|null} [def=null] the value to return if nothing else found * @param {{}} [opts={}] the options object to check before the environment * @returns {string|null} the value of the key found in the options object, environment, or the * default supplied */ export declare function getCustom(key: string, def?: string | null, opts?: {}): string | null; /** * Utility function for looking up custom variable for a binary path. * Looks in opts, then environment variables, for a key with TRUSTIFY_DA_x_PATH, where x is an * uppercase version of the supplied name. The name is returned if neither contains the key. * @param name the binary name to look for, will be returned as value in nothing else found * @param {{}} [opts={}] the options object to check before the environment * @returns {string|null} the value of the key found in the options object, environment, or the * original name supplied */ export declare function getCustomPath(name: any, opts?: {}): string | null; /** * Utility function for determining whether wrappers for build tools such as gradlew/mvnw should be * preferred over invoking the binary directly. * @param {string} name - binary for which to search for its wrapper * @param {{}} opts - the options object to check before the environment * @returns {boolean} whether to prefer the wrapper if exists or not */ export declare function getWrapperPreference(name: string, opts?: {}): boolean; export declare function environmentVariableIsPopulated(envVariableName: any): boolean; /** * Utility function for handling spaces in paths on Windows * @param {string} path - path to be checked if contains spaces * @return {string} a path with all spaces escaped or manipulated so it will be able to be part * of commands that will be invoked without errors in os' shell. */ export declare function handleSpacesInPath(path: string): string; /** * Utility function for creating Purl String * @param name the name of the artifact, can include a namespace(group) or not - namespace/artifactName. * @param version the version of the artifact * @returns {PackageURL|null} PackageUrl Object ready to be used in SBOM */ export declare function toPurl(type: any, name: any, version: any): PackageURL | null; /** * Utility function for creating Purl Object from a Purl String * @param strPurl the Purl String * @returns {PackageURL|null} PackageUrl Object ready to be used in SBOM */ export declare function toPurlFromString(strPurl: any): PackageURL | null; /** * * @param {string} cwd - directory for which to find the root of the git repository. */ export declare function getGitRootDir(cwd: string): string | undefined; /** * Normalize a filesystem path, lowercasing on Windows for case-insensitive comparison. * * @param {string} thePath * @returns {string} */ export declare function normalizePath(thePath: string): string; /** * Walk up from `startDir` to `repoRoot` looking for an executable wrapper script. * * @param {string} startDir - Absolute directory to start from * @param {string} wrapperName - Wrapper filename (e.g. `mvnw`, `gradlew`) * @param {string} [repoRoot] - Stop boundary (defaults to git root or filesystem root) * @returns {string | undefined} */ export declare function traverseForWrapper(startDir: string, wrapperName: string, repoRoot?: string): string | undefined; /** * Resolve a build-tool binary, preferring a wrapper when configured. * * @param {string} globalBinary - Global binary name (e.g. `mvn`, `gradle`) * @param {string} localWrapper - Wrapper filename (e.g. `mvnw`, `gradlew.bat`) * @param {string} startDir - Directory from which to start the wrapper search * @param {import('./index.js').Options} [opts={}] * @returns {string} Path to the resolved binary */ export declare function resolveBinary(globalBinary: string, localWrapper: string, startDir: string, opts?: import('./index.js').Options): string; /** this method invokes command string in a process in a synchronous way. * @param {string} bin - the command to be invoked * @param {Array} args - the args to pass to the binary * @param {import('child_process').ExecFileOptionsWithStringEncoding} [opts={}] * @returns {string} */ export declare function invokeCommand(bin: string, args: Array, opts?: import('child_process').ExecFileOptionsWithStringEncoding): string; export declare const TRUSTIFY_DA_TOKEN_HEADER = "trust-da-token"; export declare const TRUSTIFY_DA_TELEMETRY_ID_HEADER = "telemetry-anonymous-id"; export declare const TRUSTIFY_DA_SOURCE_HEADER = "trust-da-source"; export declare const TRUSTIFY_DA_OPERATION_TYPE_HEADER = "trust-da-operation-type"; export declare const TRUSTIFY_DA_PACKAGE_MANAGER_HEADER = "trust-da-pkg-manager"; /** * Adds proxy agent configuration to fetch options if a proxy URL is specified * @param {RequestInit} options - The base fetch options * @param {import("index.js").Options} opts - The trustify DA options that may contain proxy configuration * @returns {RequestInit} The fetch options with proxy agent if applicable */ export declare function addProxyAgent(options: RequestInit, opts: import("index.js").Options): RequestInit; /** * Utility function for fetching vendor tokens * @param {import("index.js").Options} [opts={}] - optional various options to pass along the application * @returns {{}} */ export declare function getTokenHeaders(opts?: import("index.js").Options): {};