github.com/jfrog/frogbot@v1.1.1-0.20231221090046-821a26f50338/action/node_modules/@actions/tool-cache/lib/tool-cache.d.ts (about) 1 /// <reference types="node" /> 2 import * as mm from './manifest'; 3 import { OutgoingHttpHeaders } from 'http'; 4 export declare class HTTPError extends Error { 5 readonly httpStatusCode: number | undefined; 6 constructor(httpStatusCode: number | undefined); 7 } 8 /** 9 * Download a tool from an url and stream it into a file 10 * 11 * @param url url of tool to download 12 * @param dest path to download tool 13 * @param auth authorization header 14 * @param headers other headers 15 * @returns path to downloaded tool 16 */ 17 export declare function downloadTool(url: string, dest?: string, auth?: string, headers?: OutgoingHttpHeaders): Promise<string>; 18 /** 19 * Extract a .7z file 20 * 21 * @param file path to the .7z file 22 * @param dest destination directory. Optional. 23 * @param _7zPath path to 7zr.exe. Optional, for long path support. Most .7z archives do not have this 24 * problem. If your .7z archive contains very long paths, you can pass the path to 7zr.exe which will 25 * gracefully handle long paths. By default 7zdec.exe is used because it is a very small program and is 26 * bundled with the tool lib. However it does not support long paths. 7zr.exe is the reduced command line 27 * interface, it is smaller than the full command line interface, and it does support long paths. At the 28 * time of this writing, it is freely available from the LZMA SDK that is available on the 7zip website. 29 * Be sure to check the current license agreement. If 7zr.exe is bundled with your action, then the path 30 * to 7zr.exe can be pass to this function. 31 * @returns path to the destination directory 32 */ 33 export declare function extract7z(file: string, dest?: string, _7zPath?: string): Promise<string>; 34 /** 35 * Extract a compressed tar archive 36 * 37 * @param file path to the tar 38 * @param dest destination directory. Optional. 39 * @param flags flags for the tar command to use for extraction. Defaults to 'xz' (extracting gzipped tars). Optional. 40 * @returns path to the destination directory 41 */ 42 export declare function extractTar(file: string, dest?: string, flags?: string | string[]): Promise<string>; 43 /** 44 * Extract a xar compatible archive 45 * 46 * @param file path to the archive 47 * @param dest destination directory. Optional. 48 * @param flags flags for the xar. Optional. 49 * @returns path to the destination directory 50 */ 51 export declare function extractXar(file: string, dest?: string, flags?: string | string[]): Promise<string>; 52 /** 53 * Extract a zip 54 * 55 * @param file path to the zip 56 * @param dest destination directory. Optional. 57 * @returns path to the destination directory 58 */ 59 export declare function extractZip(file: string, dest?: string): Promise<string>; 60 /** 61 * Caches a directory and installs it into the tool cacheDir 62 * 63 * @param sourceDir the directory to cache into tools 64 * @param tool tool name 65 * @param version version of the tool. semver format 66 * @param arch architecture of the tool. Optional. Defaults to machine architecture 67 */ 68 export declare function cacheDir(sourceDir: string, tool: string, version: string, arch?: string): Promise<string>; 69 /** 70 * Caches a downloaded file (GUID) and installs it 71 * into the tool cache with a given targetName 72 * 73 * @param sourceFile the file to cache into tools. Typically a result of downloadTool which is a guid. 74 * @param targetFile the name of the file name in the tools directory 75 * @param tool tool name 76 * @param version version of the tool. semver format 77 * @param arch architecture of the tool. Optional. Defaults to machine architecture 78 */ 79 export declare function cacheFile(sourceFile: string, targetFile: string, tool: string, version: string, arch?: string): Promise<string>; 80 /** 81 * Finds the path to a tool version in the local installed tool cache 82 * 83 * @param toolName name of the tool 84 * @param versionSpec version of the tool 85 * @param arch optional arch. defaults to arch of computer 86 */ 87 export declare function find(toolName: string, versionSpec: string, arch?: string): string; 88 /** 89 * Finds the paths to all versions of a tool that are installed in the local tool cache 90 * 91 * @param toolName name of the tool 92 * @param arch optional arch. defaults to arch of computer 93 */ 94 export declare function findAllVersions(toolName: string, arch?: string): string[]; 95 export declare type IToolRelease = mm.IToolRelease; 96 export declare type IToolReleaseFile = mm.IToolReleaseFile; 97 export declare function getManifestFromRepo(owner: string, repo: string, auth?: string, branch?: string): Promise<IToolRelease[]>; 98 export declare function findFromManifest(versionSpec: string, stable: boolean, manifest: IToolRelease[], archFilter?: string): Promise<IToolRelease | undefined>; 99 /** 100 * Check if version string is explicit 101 * 102 * @param versionSpec version string to check 103 */ 104 export declare function isExplicitVersion(versionSpec: string): boolean; 105 /** 106 * Get the highest satisfiying semantic version in `versions` which satisfies `versionSpec` 107 * 108 * @param versions array of versions to evaluate 109 * @param versionSpec semantic version spec to satisfy 110 */ 111 export declare function evaluateVersions(versions: string[], versionSpec: string): string;