feat(gitlab): add repository branches and tags endpoints and corresponding types
This commit is contained in:
@@ -7,6 +7,8 @@ import type {
|
||||
IGitLabVariable,
|
||||
IVariableOptions,
|
||||
IGitLabProtectedBranch,
|
||||
IGitLabBranch,
|
||||
IGitLabTag,
|
||||
IGitLabPipeline,
|
||||
IGitLabJob,
|
||||
ITestConnectionResult,
|
||||
@@ -370,6 +372,28 @@ export class GitLabClient {
|
||||
);
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Repository Branches & Tags
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
public async getRepoBranches(projectId: number | string, opts?: IListOptions): Promise<IGitLabBranch[]> {
|
||||
const page = opts?.page || 1;
|
||||
const perPage = opts?.perPage || 50;
|
||||
return this.request<IGitLabBranch[]>(
|
||||
'GET',
|
||||
`/api/v4/projects/${encodeURIComponent(projectId)}/repository/branches?page=${page}&per_page=${perPage}`,
|
||||
);
|
||||
}
|
||||
|
||||
public async getRepoTags(projectId: number | string, opts?: IListOptions): Promise<IGitLabTag[]> {
|
||||
const page = opts?.page || 1;
|
||||
const perPage = opts?.perPage || 50;
|
||||
return this.request<IGitLabTag[]>(
|
||||
'GET',
|
||||
`/api/v4/projects/${encodeURIComponent(projectId)}/repository/tags?page=${page}&per_page=${perPage}`,
|
||||
);
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Protected Branches
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user