forked from NodeSecure/gitlab
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.d.ts
46 lines (43 loc) · 1.16 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
export interface DownloadOptions {
/**
* The destination (location) to extract the tar.gz
*
* @default process.cwd()
*/
dest?: string;
/**
* The default gitlab branch name (master, main ...).
* By default it fetch the "default" gitlab branch.
*
* @default null
*/
branch?: string | null;
/**
* Authentication token for private repositories
*
* @default process.env.GITLAB_TOKEN
*/
token?: string;
}
export type ExtractOptions = DownloadOptions & {
/**
* Remove the tar.gz archive after a succesfull extraction
*
* @default true
*/
removeArchive?: boolean;
}
export interface DownloadResult {
/** Archive or repository location on disk */
location: string;
/** Gitlab repository name */
repository: string;
/** Gitlab organization name */
organization: string;
/** Gitlab branch name */
branch: string;
}
export function download(repo: string, options?: DownloadOptions): Promise<DownloadResult>;
export function downloadAndExtract(repo: string, options?: ExtractOptions): Promise<DownloadResult>;
export function setToken(gitlabToken: string): void;
export function setUrl(gitlabUrl: string | URL): void;