UNPKG

danger

Version:
52 lines (51 loc) 2.89 kB
import type * as Types from "@gitbeaker/rest"; import { Env } from "../../ci_source/ci_source"; import { RepoMetaData } from "../../dsl/RepoMetaData"; export type GitLabAPIToken = string; export type GitLabOAuthToken = string; export interface RootGitLabAPICredentials { host: string; } export interface GitLabAPICredentialsOptionsWithAccessToken extends RootGitLabAPICredentials { token: GitLabAPIToken; } export interface GitLabAPICredentialsOptionsWithOAuthToken extends RootGitLabAPICredentials { oauthToken: GitLabOAuthToken; } export type GitLabAPICredentials = GitLabAPICredentialsOptionsWithAccessToken | GitLabAPICredentialsOptionsWithOAuthToken; export declare function getGitLabHostFromEnv(env: Env): string; export declare function getGitLabAPICredentialsFromEnv(env: Env): GitLabAPICredentials; declare class GitLabAPI { readonly repoMetadata: RepoMetaData; readonly repoCredentials: GitLabAPICredentials; private readonly api; private readonly hostURL; private readonly d; private readonly repoSlug; private readonly prId; constructor(repoMetadata: RepoMetaData, repoCredentials: GitLabAPICredentials); get projectURL(): string; get mergeRequestURL(): string; get apiInstance(): import("@gitbeaker/core").Gitlab<boolean>; getUser: () => Promise<Types.ExpandedUserSchema>; getMergeRequestInfo: () => Promise<Types.ExpandedMergeRequestSchema>; updateMergeRequestInfo: (changes: Types.EditMergeRequestOptions) => Promise<Types.ExpandedMergeRequestSchema>; getMergeRequestApprovals: () => Promise<Types.MergeRequestLevelMergeRequestApprovalSchema>; getMergeRequestDiffs: () => Promise<Types.MergeRequestDiffSchema[]>; getMergeRequestCommits: () => Promise<Types.CommitSchema[]>; getMergeRequestDiscussions: () => Promise<Types.DiscussionSchema[]>; getMergeRequestNotes: () => Promise<Types.MergeRequestNoteSchema[]>; createMergeRequestDiscussion: (content: string, options?: { position?: Types.DiscussionNotePositionOptions; }) => Promise<Types.DiscussionSchema>; createMergeRequestNote: (body: string) => Promise<Types.MergeRequestNoteSchema>; updateMergeRequestDiscussionNote: (discussionId: string, noteId: number, body: string) => Promise<Types.MergeRequestDiscussionNoteSchema>; updateMergeRequestNote: (id: number, body: string) => Promise<Types.MergeRequestNoteSchema>; deleteMergeRequestDiscussionNote: (discussionId: string, noteId: number) => Promise<boolean>; deleteMergeRequestNote: (id: number) => Promise<boolean>; getFileContents: (path: string, slug?: string, ref?: string) => Promise<string>; getCompareChanges: (base?: string, head?: string) => Promise<Types.CommitDiffSchema[]>; addLabels: (...labels: string[]) => Promise<boolean>; removeLabels: (...labels: string[]) => Promise<boolean>; } export default GitLabAPI;