Skip to content
Snippets Groups Projects
Commit 7fd43ba4 authored by michael.minelli's avatar michael.minelli Committed by michael.minelli
Browse files

SharedGitlabManager => Add getRepository function

parent 3af7942b
No related branches found
No related tags found
No related merge requests found
import axios from 'axios'; import axios from 'axios';
import SharedConfig from '../config/SharedConfig'; import SharedConfig from '../config/SharedConfig';
import * as GitlabCore from '@gitbeaker/core'; import * as GitlabCore from '@gitbeaker/core';
import { GitbeakerRequestError } from '@gitbeaker/requester-utils'; import { GitbeakerRequestError } from '@gitbeaker/requester-utils';
import { Gitlab, PipelineSchema, UserSchema } from '@gitbeaker/rest'; import { Gitlab, PipelineSchema, ProjectSchema, UserSchema } from '@gitbeaker/rest';
import GitlabToken from '../types/Gitlab/GitlabToken'; import GitlabToken from '../types/Gitlab/GitlabToken';
import { StatusCodes } from 'http-status-codes'; import { StatusCodes } from 'http-status-codes';
class SharedGitlabManager { class SharedGitlabManager {
...@@ -79,6 +79,10 @@ class SharedGitlabManager { ...@@ -79,6 +79,10 @@ class SharedGitlabManager {
} }
} }
async getRepository(projectIdOrNamespace: string): Promise<ProjectSchema> {
return this.executeGitlabRequest(() => this.api.Projects.show(projectIdOrNamespace));
}
async getRepositoryPipelines(repoId: number, branch: string = 'main'): Promise<Array<PipelineSchema>> { async getRepositoryPipelines(repoId: number, branch: string = 'main'): Promise<Array<PipelineSchema>> {
return await this.executeGitlabRequest(async () => { return await this.executeGitlabRequest(async () => {
return await this.api.Pipelines.all(repoId, { return await this.api.Pipelines.all(repoId, {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment