Options
All
  • Public
  • Public/Protected
  • All
Menu

Class GitLabApi

This class aggregates the logic to interact with the GitLab API.

Its private properties are used to cache GET responses that may be used in more than one Bot Action in order to reduce overall number of requests.

Each instance of this class constructs instances of the utility classes URI and FetchWrapper.

Hierarchy

  • GitLabApi

Index

Constructors

constructor

  • new GitLabApi(token: string, projectId: number, mergeReqId: number, baseURI: string): GitLabApi

Properties

Private MRChanges

Private MRCommits

Readonly baseURI

baseURI: string

Readonly fetchWrapper

fetchWrapper: FetchWrapper

Readonly mergeReqId

mergeReqId: number

Readonly projectId

projectId: number

Readonly token

token: string

Readonly uriBuilder

uriBuilder: URI

Methods

deleteEmoji

deleteMRNote

  • HELPER METHOD FOR TESTS ONLY

    remarks

    This will only delete comments directly posted on the MR - it will NOT delete comments that are listed on MR that come from commits or other sources - if it's tried, a 403 Forbidden status will be returned :)

    Parameters

    • noteId: number

    Returns Promise<GetResponse>

editMRNote

getAllEmojis

getAllMRNotes

  • remarks

    If api returns a page with less than 100 notes, that is the last page available. This method should never use cached responses, as it may be called multiple times to get additional pages of results.

    Parameters

    • page: number

    Returns Promise<GetResponse>

getConfigurationFile

getMRApprovalConfig

getMergeRequestsByAssigneeId

  • getMergeRequestsByAssigneeId(assigneeId: number, threshold: number): Promise<GetResponse>

getSingleMR

getSingleMRChanges

getSingleMRCommits

newMRNote

postEmoji

Generated using TypeDoc